![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| reading ps command's output line by line | s. murat | Shell Programming and Scripting | 5 | 05-22-2008 01:23 AM |
| how to make a line BLINKING in output and also how to increase font size in output | mail2sant | Shell Programming and Scripting | 3 | 04-14-2008 04:30 AM |
| Multi-line output to single line | LinuxRacr | Shell Programming and Scripting | 7 | 02-26-2008 07:05 AM |
| How to get only the first line of output? | sanchopansa | Shell Programming and Scripting | 12 | 10-09-2006 01:04 PM |
| Making multi line output appear on one line | djsal | Shell Programming and Scripting | 1 | 10-07-2004 03:21 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
sed output without a new line
I am reading file and extracting the paragraph between START and END tags.
contents of abc.txt Remember that $ means the last line in a file. You can also specify a range based on two regexps. Try START Note that this prints all blocks starting with lines containing regexp1 through lines containing regexp2, not just the first one. If there isn't a matching regexp2 for a line containing regexp1, then we get all lines through to the end of the file. END Code:
filename = "abc.text" sed -n "/START/,/END/p' $filename > output.dat I get the ouput as the regexp is.but without a newline at the end of the line to each line. How do i get the output each line ending with newline. Last edited by ganesh_mak; 06-04-2008 at 07:50 AM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Looks flawless. Your textfile might have something else but newlines that is not recognized by sed (maybe crlf ie. ^M from windows?).
Do an Code:
od -cx yourtextfile |
|||
| Google The UNIX and Linux Forums |