add word to each line of the file?
If I want to insert a word into the beginning of each line in a file do I use the command "paste"?
from is a test is a test2 is a test3 to this is a test this is a test2 this is a test3 if so whats the format? |
I would use sed instead...
Code:
$ cat file |
Or for the same file "sed -i -e 's/is/this is/' filename"
The "g" would add "this" to all words "is" in a line. |
Your right makuyl, good catch...
|
hi there,
just to contribute: if your line does not share the same pattern you can use ^ Code:
sed "s/^/this /g" your_file slackie1000 |
All times are GMT -5. The time now is 04:13 AM. |