M474746
1
Hi list,
I have to combine two lines and adding the " - " in between.
So:
Here's sentence A
Here's Senctence B
Here's sentence A - Here's Senctence B
I know how to us SED: sed '$!N;s/\n/ /' for combining tow lines. But how do
I insert the " - " correctly?
Thanks!
Martijn
(os 10.5.6, bash)
kurumi
2
$ ruby -0777 -ne 'print $_.split("\n").join(" - ")' file
birei
3
Hi,
I think you were in the point. I copied your sentence adding the '-' char.
$ sed '$ !N; s/\n/ - /' infile
Regards,
Birei
i would do..
a='sentence a'
b='sentence b'
c="${a} - ${b}"
echo ${c}
M474746
5
H guys,
thanks for all the suggestions. many roads to follow..
I have a look at them.
cheers
martijn