nica
1
Hi,
I have a data as follow:
1 400
2 239
3 871
4 219
5 543
6 ...
7 ...
.. ...
.. ...
99 818
100 991
I want to replace the sequence number (column 1) that start from 150. The output should like this:
150 400
151 239
153 871
154 219
155 543
...
...
Can anyone tell me AWK code for this....
Thanks
kshji
2
#!/bin/ksh # or bash
# using ex.: cat somefile | ./thisscript
while read a b
do
(( a+=149 ))
echo "$a $b"
done
---------- Post updated at 06:40 PM ---------- Previous update was at 06:38 PM ----------
Awk:
awk '{print $1+149,$2 }' file
# or only col1 is edited, no need to know number of columns
awk '{$1+=149; print }' file