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
but the content of the output i am getting is without newline.
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 11:50 AM..
Looks flawless. Your textfile might have something else but newlines that is not recognized by sed (maybe crlf ie. ^M from windows?).
Do an
If the newlines show up as single "\n", then I don't know what's wrong.
I have a file of 100,000 lines in the below format:
answer.bed
chr1 957570 957852
NOC2L
chr1 976034 976270
PERM1
chr1 976542 976787
PERM1
I need to get each on one line and so far what I have tried doesn't seem to be working. Thank you... (3 Replies)
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
Hi
I've been trying to search but couldn't quite get the answer I was looking for.
I have a a file that's like this
Time, 9/1/12
0:00, 1033
0:10, 1044
...
23:50, 1050
How do I make it so the file will be like this?
9/1/12, 0:00, 1033
9/1/12, 0:10, 1044
...
9/1/12, 23:50, 1050
I... (4 Replies)
Hi all .... vexing problem here ...
I am using sed to replace some special characters in a .txt file:
sed -e 's/_<ED>_/_355_/g;s/_<F3>_/_363_/g;s/_<E1>_/_341_/g' filename.txt
This command replaces <ED> with í , <F3> with ó and <E1> with á.
When I run the command to standard output, it works... (1 Reply)
hello
i try this command in console mode
sed -e :a -e '/$/N; s/\(\)\n/\1 /; ta' test.txt > result.txt
i have in the output screen "Output line too long" for multiples lines
can you please tell me how can i retrieve those long lines during the execution ?
Another thing very... (5 Replies)
I have been trying to remove some improperly formatted lines of output from fortran code I have been using. The problem is that I have some singularities in the math for some points that causes an incorrectly large value to be reported that exceeds the normal formating set in the code resulting in... (2 Replies)
hey gents,
I'm working on something that will use snmpwalk to query the devices on my network and retreive the device name, device IP, device model and device serial. I'm using Nmap for the enumeration and sed to clean up the results for use by snmpwalk. Once i get all the data organized I'm... (8 Replies)
how to make a line BLINKING in output and also how to increase font size in output
suppose in run a.sh script
inside echo "hello world "
i want that this should blink in the output and also
the font size of hello world should be big ..
could you please help me out in this (3 Replies)