I face a problem I can not solve: I have different lines in a file and some of them are ending with [CR][LF] ie "\r\n" and the others are ending with [LF] "\n".
My aim is to supress the string "\r\n" and concatenate that line with the following one.
For example:
Saying I have a file 4_test.csv with the 4 following lines:
My aim is to get as a result a file with only the two following lines:
I tried different syntax using sed but I was not able to suppress the two consecutive characters '\r\n' !
Any kind of idea would be greatly appreciated ... Thanks a lot,
I am trying to use sed to delete multiple lines in a file. The problem is that I need to search for a certain line and then once found delete it plus the next 4 lines. For instance if I had a file that consisted of the following lines:
#Data1.start
(
(Database= data1)
(Name = IPC)... (1 Reply)
I take the /etc/passwd file and print it out, but I only want the lines that end with sh.
I have
cat /etc/passwd | sed '/sh/!d' Which prints out all lines that have sh somewhere in it.
So I added $, which I thought matches the ends on lines, but its not working, like for example I have have... (5 Replies)
FileA
NAME STATE CITY
---- ---- -----
abc ca ca
bcc ny ny
def nj nj
(3 rows affected)
Q1) I want to delete the second row with is ---- ---- -----.
Can delete 2nd row using following
sed '2d' FileA >FileB
but incase the second record is not ---- ---- -----.
then data will... (3 Replies)
Hi All,
Please can anyone help me as am deleting a line in a file with the below script:
sed '/"$value"/d' redirects.virgin-atlantic.com.conf > olist
where $value is a variable where the pattern to be matched is stored.
I am not getting any error also but the line containing the pattern... (2 Replies)
Hi all,
First off, Thank you all for the knowledge I have gleaned from this site!
Deleting Records from a text file... sed paragraphs
The following code works nearly perfect, however each time it is run on the log file it adds a newline at the head of the file, run it 5 times, it'll have 5... (1 Reply)
Hi There!
I've got a tab delimited text file (output from a software) to which I would like to delete specific strings from one of the columns. I have tried several sed codes, but they do not seem to work for me. I can manage to delete a specific word, but this is of no use, as I what I want to... (3 Replies)
Hi there,
I'd like to delete the beginning of a line up until it finds a certain word or character string: in this case, I'd like to delete each line up to the word "mounting".
Thanks ;)
Susan (12 Replies)
Hi guys, this is my first post, though I've been looking around the forums for a while trying to find a solution to my problem. I want to be able to take a several lines of text (an out put from get-iplayer and ls to be precise) and only keep the crazy alphanumerical code in each line. For example:... (6 Replies)
sed /'1-2'/&^/ filename
suppose there is a file containing three lines , how do we do delete the word from each line?
hyter efr frf
rerfer efe ewd
cdcf evrfgf erfv
the output has to look like
frf
ewd
erfv (2 Replies)