?

Log in

No account? Create an account

Previous Entry | Next Entry

 Problem : Replace the 100's in 3rd field with different numbers.

Sample file
jsaikia@KORA:~/prac$ cat fl
12|13|100|s
12|13|100|s
100|13|100|s
12|13|100|s


Output:

jsaikia@KORA:~/prac$ awk 'BEGIN{OFS=FS="|"}$3==100{$3=NR*131}{print}' fl
12|13|131|s
12|13|262|s
100|13|393|s
12|13|524|s

Profile

jaduks
Jadu Kumar Saikia

Latest Month

January 2008
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  
Powered by LiveJournal.com
Designed by chasethestars