Say I wanted to append a string to the end of every line and um...prepend a string to each line as well. What editor would you use to make it super duper easy?
Thanks in advance (also I'm going to check the suggest a program thread right after this)
Printable View
Say I wanted to append a string to the end of every line and um...prepend a string to each line as well. What editor would you use to make it super duper easy?
Thanks in advance (also I'm going to check the suggest a program thread right after this)
I don't know if it does what you wish or not, but I have found TED Notepad to have more options than I can list. May wish to check that out.
Really, there are a million different "advanced text editors" which are mostly capable of the same things, but my choice would be SciTE.
First you have to hit Ctrl+H to bring up the replace dialog. Second, check the "evaluate backslash expressions" box. Third, replace the text "\r\n" with "[append string]\r\n[prepend string]". :p
I don't think any editor will make that super duper easy. If you do stuff like that often I recommend learning basic regular expressions and using a tool like SciTE or Notepad++.
Edit: Actually, it's pretty easy to record a macro in Notepad++ and running a loop on that macro which will do the job.
Editga: Apparently Notepad++ also has a "column editor" which lets you insert text into all rows on a given column. That makes prepending super duper easy, but it pads the shorter lines if you try to append. There's probably a way around that.
Surely this can be done with a simple one line command using sed at a command line? :D This works for me:
sed 's/^.*$/prepend text&append text/' inputfile.txt > result.txt
That'd get around the problem of it not altering the first and possibly last lines in the file using face's method :monster:
what OS you trying it on? syntax may vary, but that works in cygwin for me :p
Install cygwin then then try from the cygwin prompt instead of DOS prompt, since I did it from cygwin on WinXP :D