Search Results

Search: Posts Made By: zaq1xsw2
1,903
Posted By Akshay Hegde
$ awk '{print NF == 3 ? $2 OFS $3 : $2}' FS=":"...
$ awk '{print NF == 3 ? $2 OFS $3 : $2}' FS=":" OFS=":" file
OR
$ awk '{$0 = NF == 3 ? $2 OFS $3 : $2}1' FS=":" OFS=":" file

1002 ZN:VTJ3J3C131
1002 ZN:VTM4M4P123%5
1002 ZN:VTM3M3P132%5...
10,307
Posted By MadeInGermany
Another formatting trick { sep="" ...
Another formatting trick

{
sep=""
for (i=1; i<=NF; i++)
if (i != m && i != n) {
printf sep"%s", $i
sep=OFS
}
print ""
}
10,307
Posted By alister
These suggestions should not be trusted for a...
These suggestions should not be trusted for a moment. Blindly treating literal text data as regular expressions is asking for trouble. Both sub($a FS, x) and sub($(b-1) FS, x) are problematic in...
10,307
Posted By Jotne
aliester is correct. This can be cleaned by ...
aliester is correct.
This can be cleaned by
awk '{$a=$b="";gsub(FS "+",FS)} 1' a=$m b=$n df_test_removing_column
10,307
Posted By Jotne
This should do it awk -F, '{$a=$b="";gsub(FS...
This should do it
awk -F, '{$a=$b="";gsub(FS "+",FS)} 1' a=$m b=$n OFS=, df_test_removing_column
10,307
Posted By Jotne
awk '{$a="";$b=""} 1' a=$m...
awk '{$a="";$b=""} 1' a=$m b=$n
1,806
Posted By vbe
ran:/home/vbe/wks $ ksh001 -f -t ksh001:usage:...
ran:/home/vbe/wks $ ksh001 -f -t
ksh001:usage: [-f file] | [-d directory]
ran:/home/vbe/wks $ ksh001 -f -titi.txt
File name is -titi.txt
ran:/home/vbe/wks $
Solution:
-? )
echo...
1,266
Posted By Don Cragun
With the sample input you've given, the following...
With the sample input you've given, the following works. But it makes lots of assumptions and you haven't given a real specification of the input file format so it could go horribly wrong with...
Showing results 1 to 8 of 8

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