![]() |
|
|
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 !! |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
sed question
Hello,
I have a file where I need to search for a word in a line and then break the line into two lines. I have the following file and I want the below result File1: PROJ=Workflow System CPPDOC=QUOTE PROJ=center Workflow System CPPDOC=CONTRACT PROJ=Workflow System CPPDOC=CPP CENTER PROJ=center Workflow System CPPDOC=CPP TEAM PROJ=CP flow System CPPDOC=TEST PLAN Result: PROJ=Workflow System CPPDOC=QUOTE PROJ=center Workflow System CPPDOC=CONTRACT PROJ=Workflow System CPPDOC=CPP CENTER PROJ=center Workflow System CPPDOC=CPP TEAM PROJ=CP flow System CPPDOC=TEST PLAN I started by trying to print the first part of the line up to CPPDOC for each line. sed -n '/PROJ/,/CPPDOC/p' File1 but its just dumping the contents of File1 can someone explain why sed is not picking up the text with between the regular expresions? Also, can someone shed light on another way to get the resulting file? thanks |
| Bookmarks |
| Tags |
| sed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|