in reply to How can I remove 0 from first line and empty space from the start of the following line and join them
This will look for a 0 at the start of every line followed by spaces and remove them (if this pattern does not exist it leaves the line alone), and then print the line back out to file you pass it the i.bak will create a backup file with the filename as file_name.bak. I believe this is what you are asking for.perl -pi.bak -e "s/^0\s+//;" file_name
UPDATE: I neglected the second line part. My mistake. See the responses below for a better more complete answer.
-Enlil
|
|---|