![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| editing ELF file | tejuwala | Linux | 1 | 05-18-2008 12:22 AM |
| How to editing a txt file | aaabbb123123 | Shell Programming and Scripting | 3 | 03-07-2008 12:31 AM |
| Editing file | rahul303 | Shell Programming and Scripting | 4 | 09-23-2007 11:49 PM |
| Editing File using awk/sed | Mohammed | Shell Programming and Scripting | 4 | 05-16-2007 12:00 PM |
| File editing using awk | rinku11 | Shell Programming and Scripting | 2 | 11-23-2006 11:34 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Pls help me with file editing using awk
Hi all,
Pls help me with file editing using awk. I have a text file with the below format. "STANDARD VOLUME ","2009","BUX","V","JCBH49","NF", 001413 "VENDOR MATERIAL-STD ","2009","BUX","V","JCBH49","NF", 009948 "INBOUND TRANS-STD ","2009","BUX","V","JCBH49","NF", 000264 "DIRECT LABOR-STD ","2009","BUX","V","JCBH49","NF", 000010 "VARIABLE BURDEN-STD ","2009","BUX","V","JCBH49","NF", 000062 "FIXED BURDEN-STD ","2009","BUX","V","JCBH49","NF", 000081 Here I want to retrieve the records of only "VENDOR MATERIAL-STD "and write to another text file. Also I want to replace "V" with “Prod Matl Cost PU Base Vehicle” and "O" with “Prod Matl Cost PU Avg Option” while writing to another file. Thanks in advance. |
|
||||
|
Thanks Yogesh.
I tried the below and got the below message. #!/bin/ksh sed -n -e '/VENDOR MATERIAL-STD / { s/"V"/Prod Matl Cost PU Base Vehicle./ ; s/"O"/.Prod Matl Cost PU Avg Optio n./ ; p }' /clocal/fme/essbase/data/cash/goldbooklesspowertrain.txt > /clocal/fme/essbase/data/cash/newgoldbooklesspowertrain. txt Message: sed: command garbled: /VENDOR MATERIAL-STD / { s/"V"/Prod Matl Cost PU Base Vehicle./ ; s/"O"/.Prod Matl Cost PU Avg Option./ ; p } |
![]() |
| Bookmarks |
| Tags |
| sed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|