Search Results

Search: Posts Made By: svn
1,810
Posted By Don Cragun
In addition to the suggestion Scrutinizer...
In addition to the suggestion Scrutinizer provided, note that the command in post #1 in this thread:
awk '$3="XYX"' FS=, OFS='|' filename.txtproduces the output:
> BRYAN BAKER|4/4/2015|518...
1,810
Posted By Scrutinizer
You could do this: awk '{gsub(/[0-9]/,"&...
You could do this:
awk '{gsub(/[0-9]/,"& ",$3)}1' FS=\| OFS=\| file
Which would will append a space to any digit in field 3..

A bit more accurate (if needed) maybe would be to use the split()...
5,373
Posted By Ikon
sed 's/ *| */,/g' file or a shortened...
sed 's/ *| */,/g' file


or a shortened version of bartus11's

perl -pe 's/ *\| */,/g' file
10,404
Posted By rdcwayx
awk -F "" '{for (i=1;i<=NF;i++) if...
awk -F "" '{for (i=1;i<=NF;i++) if (i==106||i==157||i==237) $i="xxx"}1' OFS="" urfile
10,404
Posted By bartus11
I know its Perl, and it looks ugly, but if you...
I know its Perl, and it looks ugly, but if you don't mind that then here it goes:perl -pe 's/(.{105}).(.{50}).(.{79}).(.*)/\1xxx\2xxx\3xxx\4/' file > out.file I hope I didn't mess numbering ;)
Showing results 1 to 5 of 5

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