|
sed pattern recognition with consecutive lines: msg#00070editors.sed.user
I have been playing with this all morning and have not found the solution so hopefully someone has a suggestion. What I am trying to do is have sed recognize a pattern of words falling on consecutive lines, for example if I had an example file structured as: I have been there and I do not like it and I would like to make the file look like this: I have been there and We can like it My thought was something like: sed 's/I\ndo\nnot/We\ncan/' example.file but this does not work. I can make the newline (\n) work in the replacement part, but it does not seem to work in the pattern recognition part. Any ideas? ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/dkFolB/TM --------------------------------------------------------------------~-> -- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/sed-users/ <*> To unsubscribe from this group, send an email to: sed-users-unsubscribe@xxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: How to extract Numbers: 00070, hq00e |
|---|---|
| Next by Date: | Re: sed one-liner?: 00070, Eric Pement |
| Previous by Thread: | How to extract Numbersi: 00070, Surya Kiran Gullapalli |
| Next by Thread: | Re: sed pattern recognition with consecutive lines: 00070, Eric Pement |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |