![]() |
| >>> Click
here to download Final Fantasy Ringtones |
| |
#1 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) |
| | |
| |
| Site Staff | 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]". ![]() |
| | |
| | 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 Rantzien; 07-19-2008 at 12:33 AM. |
| | |
| Administrator | Surely this can be done with a simple one line command using sed at a command line? 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 ![]() |
| | |
| | I'm getting 'not enough arguments' error. |
| | |