Skip to main content
added 44 characters in body
Source Link
jesse_b
  • 41.5k
  • 14
  • 108
  • 162

ok...haveI have the following csv file

hostname1,this is a test,001^M

hostname2,this is

a test,002^M

hostname3,this is

a:

test,003^M

hostname1,this is a test,001^M
hostname2,this is
a test,002^M
hostname3,this
is
a
test,003^M

theThe first line is the proper format of the line. iI want the other lines to follow the same format. theThe problem is for the second column -, some of them have carriage returns so createsthe third column is on a new lines -line, but iI want to use sed to join all the lines regardless of how many lines they broke apart (follow the first line format).

ok...have the following csv file

hostname1,this is a test,001^M

hostname2,this is

a test,002^M

hostname3,this is

a

test,003^M

the first line is the proper format of the line. i want the other lines to follow the same format. the problem is for the second column - some of them have carriage returns so creates a new lines - but i want to use sed to join all the lines regardless of how many lines they broke apart (follow the first line format)

I have the following csv file:

hostname1,this is a test,001^M
hostname2,this is
a test,002^M
hostname3,this
is
a
test,003^M

The first line is the proper format of the line. I want the other lines to follow the same format. The problem is for the second column, some of them have carriage returns so the third column is on a new line, but I want to use sed to join all the lines regardless of how many lines they broke apart.

Source Link

using sed how to append N number of lines

ok...have the following csv file

hostname1,this is a test,001^M

hostname2,this is

a test,002^M

hostname3,this is

a

test,003^M

the first line is the proper format of the line. i want the other lines to follow the same format. the problem is for the second column - some of them have carriage returns so creates a new lines - but i want to use sed to join all the lines regardless of how many lines they broke apart (follow the first line format)