Hi
I have to convert the data in a file
*******
01-20-09 11:14AM 60928 ABC Valuation-2009.xls
01-20-09 11:16AM 55808 DEF GHI Equation-2009.xls
01-20-09 11:02AM 52736 ABC DF Valuation-2009.xls
01-20-09 11:06AM 89600 THE Valuation.xls
*******
to
*********
01-20-09| ABC Valuation-2009.xls|
01-20-09| DEF GHI Equation-2009.xls|
01-20-09| ABC DF Valuation-2009.xls|
01-20-09| THE Valuation.xls|
*********
Can you give script to do this.
Thanks
nawk -v OFS='|' '{$2=$3="";print $0 OFS}' myInputFile
Hi,
Its making output to
01-20-09|DEF|GHI|Equation-2009.xls|
But I need in the format of
01-20-09| DEF GHI Equation-2009.xls|
Can you please give the script.
Thanks.
ranj1
4
awk '{printf("%s | %s %s|\n", $1,$4,$5); }' filename
Note: Only if the file has the same fixed no of fields.
try this:
awk '{$2="";$3="|";print $0 $3}' inputfile
Hi,
Its giving output as
01-20-09 | ABC Valuation-2009.xls|
Can you make it to
01-20-09|ABC Valuation-2009.xls|
Thanks.
try this:
awk -v OFS='' '{$2="";$3="|";print $0 $3}' inputfileName