I have a file like:
72810 82:28:1
this is text
hello world
72810 82:28:12
some more text
hello wolrd again
I need to replace the newline characters in just the lines containing 72810* But there's a catch: I have tried the following:
sed 's/\n/ /g' myfile.txt
But this doesn't work.
I have also tried:
cat myfile.txt | perl -p -e 's/72810.*\n/72810 /g'
But this doesn't save the full original text (72810 82:28:1 or 72810 82:28:12 in this case).
What do I need to do to end up with the file looking like:
72810 82:28:1 this is text
hello world
72810 82:28:12 some more text
hello world again
By the way, I'm using solaris.