![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Count of matched pattern occurance | palash2k | UNIX for Dummies Questions & Answers | 3 | 04-24-2008 04:33 PM |
| Concatenating multiple lines to one line if match pattern | phixsius | Shell Programming and Scripting | 13 | 01-24-2008 11:02 PM |
| Delete a block of text delimited by blank lines when pattern is found | gleu | Shell Programming and Scripting | 17 | 12-16-2007 11:30 PM |
| How to delete lines do NOT match a pattern | JumboGeng | UNIX for Dummies Questions & Answers | 1 | 09-20-2006 06:52 AM |
| appending with sed based on matched pattern | jack1981 | Shell Programming and Scripting | 2 | 07-20-2006 07:54 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
SED: match pattern & delete matched lines
Hi all,
I have the following data in a file x.csv: > ,this is some text here > ,,,,,,,,,,,,,,,,2006/11/16,0.23 > ,,,,,,,,,,,,,,,,2006/12/16,0.88 < ,,,,,,,,,,,,,,,,this shouldnt be deleted I need to use SED to match anything with a > in the line and delete that line, can someone help me out? Last edited by not4google; 11-22-2006 at 07:17 AM.. Reason: Ammended Title |
|
||||
|
Thanks for the responses - is it possible to have multiple sed commands in a statement so I can for example delete the lines with ">" and then delete instances of lines with "---" in them? I tried but it doesnt like this: Code:
sed -e '/>/d' '/---/d' x Thanks again, |
|
||||
|
Thanks for the quick responses, I want to search for a particular string and then append to the first line, is this possible with something like the following: Code:
sed -e /test/s/$/ testString/; x.csv This appends testString to the EOL (where test is matched) but I need to append testString to the line above the one matched, is this possible? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|