Search Results

Search: Posts Made By: alienated
9,615
Posted By Scott
Hi. You need double quotes around the sed,...
Hi.

You need double quotes around the sed, otherwise the shell won't expand $i.

Also, after deleting each field, you need to subtract 1 from other field numbers (what was field 2, after...
3,692
Posted By Ikon
a="a1;b1;c1;d11;e1"; echo $1 | sed...
a="a1;b1;c1;d11;e1"; echo $1 | sed 's/[a-z0-9]*;/;/4'
3,692
Posted By vgersh99
echo 'a1;b2;c33;d4;e5' | nawk -F';' '{$4=""}1'...
echo 'a1;b2;c33;d4;e5' | nawk -F';' '{$4=""}1' OFS=';'
OR
echo 'a1;b2;c33;d4;e5' | sed 's/[^;][^;]*;/;/4'
5,122
Posted By alister
awk '!/^[^:]+:[UCD]/ {print; next} {$0=$1} /U$/...
awk '!/^[^:]+:[UCD]/ {print; next} {$0=$1} /U$/ {a="pdate"} /C$/ {a="reate"} /D$/ {a="elete"} {print $0a}'

---------- Post updated at 01:42 PM ---------- Previous update was at 01:21 PM ----------...
5,122
Posted By alister
A tweaked version of jim's awk: awk '{$0=$1}...
A tweaked version of jim's awk:
awk '{$0=$1} /U$/ {a="pdate"} /C$/ {a="reate"} /D$/ {a="elete"} {print $0a}'

Regards,
Alister
5,122
Posted By jim mcnamara
grep record *.txt | sort -r | awk '/U$/...
grep record *.txt | sort -r |
awk '/U$/ {a="pdate"} /C$/ {a="reate"} /D$/ {a="elete"} {$0s= $0 a; print}'
Showing results 1 to 6 of 6

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