Search Results

Search: Posts Made By: calbrex
3,121
Posted By Scrutinizer
awk '$6==55{sub("^01 ","07 "); sub("^02 ","17 ");...
awk '$6==55{sub("^01 ","07 "); sub("^02 ","17 "); sub(/^3[16] /,"67 ")}1' infile




--

That is equivalent to
awk '$1 ~ /[01236|]/ && [..]
This may be what you were after:
awk '$1 ~...
3,121
Posted By in2nix4life
Or if you like long one-liners ;-), this works: ...
Or if you like long one-liners ;-), this works:


awk '$1 ~ /[01|02|31|36]/ && $6 ~ /55/{sub("01","07");sub("02","17");sub("31","67");sub("36","67");print}' file

07 AAAAAAAA AA AA 1111 ...
3,121
Posted By Franklin52
You can do something like this: BEGIN{} { ...
You can do something like this:
BEGIN{}
{
if ($1 == "01" && $6 == "55"){
s = $0
sub("^01","07",s);{print s}
}
else if ($1 == "02" && $6 == "55"){
s = $0
...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 12:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy