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)
 Text editor suggestion?
					
				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 <a href="http://www.scintilla.org">SciTE</a>.
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]".![]()
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.
Last edited by Rantz; 07-19-2008 at 01:33 AM.
					
				
			
			
			
				Surely this can be done with a simple one line command using sed at a command line?This works for me:
<pre>sed 's/^.*$/prepend text&append text/' inputfile.txt > result.txt</pre>
That'd get around the problem of it not altering the first and possibly last lines in the file using face's method
					
				
			
			
			
				what OS you trying it on? syntax may vary, but that works in cygwin for me![]()
					
				
			
			
			
				Install cygwin then then try from the cygwin prompt instead of DOS prompt, since I did it from cygwin on WinXP![]()