Search Results

Search: Posts Made By: Abhisrajput
2,579
Posted By RudiC
Although this sed -n '1,/ LAC/p' file will...
Although this sed -n '1,/ LAC/p' file will work with the sample given, try thissed -rn '1,/^[^ ]+[ ]+LAC[ ]+/p' file to be on the safe side (within the square brackets, there's a...
2,579
Posted By Walter Misar
That is because $ would match end of line and not...
That is because $ would match end of line and not end of string. Depending on the exact nature of the input you could match for space/tab instead, or just not a letter:

sed -n '1,/^LAC[^a-zA-Z]/p'...
1,796
Posted By Corona688
These are the UNIX forums, Microsoft Notepad is a...
These are the UNIX forums, Microsoft Notepad is a Windows product.

UNIX text files end lines in \n, Windows expects lines to end in \r\n. They will look fine if you open them in Wordpad instead.
1,851
Posted By vidyadhar85
try.. sed '1d;$d' filename
try..


sed '1d;$d' filename
1,865
Posted By hanson44
$ sed -n -e "s/Date and Time: \(.*\) MST/\1/p" -e...
$ sed -n -e "s/Date and Time: \(.*\) MST/\1/p" -e "s/Number of Records: *//p" input
2013-05-11 12:23:12
000005
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 07:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy