Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I remove underscore '_' from a file header -SED/AWK commands?

Status
Not open for further replies.

rchowd2

Technical User
Jan 4, 2005
8
0
0
US
I have a file which contains the following line of header info:

_______ _______ _______ _______ _______ _______ ______ _____________ _______ ____________ ________________^MFund Cd Orgn Cd Acct Cd Prog Cd Actv Cd Locn Cd Fld Cd Field Cd Desc Grnt Yr Trans Amount Grant Ledger Amt


I tried to use SED command and replace underscore with the blank space, unfortunately fields doesn't align properly

SED 's/'_'//g' filename



Please advise so I can remove the underscore ('_') from the file header!

Thanks in advance,

Russel
 
Brute force method:
sed 's!.*Fund!Fund!' /path/to/input

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I am trying to compare two similar files which contains differnt header date information. If header dates are different from each other I would like to update the header information to the log file. Any advise how how can I go by and update the log file.

file1 header:
HEADER 2/16/0515.03.30TIO01676 CMS.TST.IWUNV676.IO01 $

file2 header:
HEADER 2/18/0515.03.30TIO01676 CMS.TST.IWUNV676.IO01 $

If file2header (example: 2/18/05) > file 1 (2/16/05)

print (file 2 header info) >> log.file

End of Program!


Thanks in advance for your help on this matter.

Russel

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top