0

I'm trying to merge these two lines that appear periodically in a text file.

travel_
by_night_and_day

I have tried:

sed '/_\nby/_by/s' input.txt > output.txt

but, it doesn't do anything.

Do I have to escape something?

It's a text file created in ubuntu 12.04

Any suggestions?

Stephen Kitt
  • 434,908

1 Answers1

2

What are you trying to do in that command?

sed 'N;s/\n/ /' input.txt > output.txt seems logical. It will print perhaps the result you want. Cheers!!!!

deosha
  • 141
  • 3
  • Here's some more info. I'm trying to merge two lines - the first line ending with one string and the second startng with another string. I don't want to merge all the lines - only the two lines that have the two specific strings at the beginning and end. – speld_rwong May 09 '16 at 13:22