text manipulation script
Hey programming brains,
I am lokin a script that can take a text file as input and add 0000 at the beginning of each line in that file. it can be in any lang like shell script or c script |
You could use:
Code:
sed 's/^/0000 /' your_file |
nice input , I checked and found only 1st line (beginning of file) is added with 0000 and nowhere else . It's windows text file I copied in linux seems vi editor considering all text file as 1 line.
is thr any method I can convert a text file as linewise(new line) after every 100 characters . |
Windows files use a different kind of line break code from Unix ones. You'll have to convert it before most *nix tools will work properly. There are a multitude of ways to do this, including opening it up in one of the common text editors like kwrite or gedit and resaving it with the unix setting, or using a command-line application like flip.
|
or use dos2unix
|
Then add a g for global in the sycamorex's solution:
Code:
sed 's/^/0000 /g' your_file |
All times are GMT -5. The time now is 04:23 AM. |