Hi, I'm looking for a sed command, which wil place a text before every line that doesn't start with a colon (:) exept for the first 3 lines. Can anybody help me? Thanx in advance.
Kluther
sed '4,$s/^[^;]/text:/' file
Hi Kurumi, thanx for your reply! It works, but there is 1 import thing that does not work: Only the lines that do not start with : must be altered. Do you have a salution? Thanx
Kluther
Hi Kurumi, I have found the previous problem. But I have a new one: the command replaces the first character of the line. I don't want this to happen. The line must stay intact.
Kluther
the least you could is to provide samples for input file and output you need.
Hi Kurumi, this is the input:
thanx,
Kluther
sed '4,${/^[^:]/s/^/:86:/}' file
Hi Kurumi, have tested this? When I try it I get " sed:Command garbled: 4,${/^[^:]/s/^/:86:/}
OH, never mind It works on Ubuntu. I think it is a version problem.
Hi Kurumi, Thank you very much for helping me out. The only thing I had to change on SCO was using gwxsed instead of sed.
Kluther
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |