Welcome to Eyes on FF!
>>> Click here to download Final Fantasy Ringtones
Oh no!
 

Post New Thread  Reply
 
LinkBack Thread Tools
Pureghetto
Itadakimasu~
Pureghetto's Avatar
Location: Barrie, ON
#1
Talking 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)
Old 07-18-2008, 10:52 PM
Reply With Quote
Pureghetto is offline  
Nominus Experse
Eight-Limbed Knot
Nominus Experse's Avatar
Location: Routes 12 & 16
Default

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.
Old 07-18-2008, 11:12 PM
Reply With Quote
Nominus Experse is offline  
o_O
Site Staff
nerd
o_O's Avatar
Location: New Zealand
Default

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]".
Old 07-18-2008, 11:14 PM
Reply With Quote
o_O is offline  
Rantzien
More burgers!
Rantzien's Avatar
Location: In... my basement? NeoTifaaa >:(
Default

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.
Old 07-19-2008, 12:21 AM
Reply With Quote
Rantzien is online now  
crono_logical
Administrator
Hypnotising you
crono_logical's Avatar
Location: Back in Time
Default

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
Old 07-19-2008, 10:23 AM
Reply With Quote
crono_logical is offline  
Pureghetto
Itadakimasu~
Pureghetto's Avatar
Location: Barrie, ON
Talking

Originally Posted by crono_logical ^
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.
Old 07-21-2008, 03:11 PM
Reply With Quote
Pureghetto is offline  
crono_logical
Administrator
Hypnotising you
crono_logical's Avatar
Location: Back in Time
Default

what OS you trying it on? syntax may vary, but that works in cygwin for me
Old 07-21-2008, 06:49 PM
Reply With Quote
crono_logical is offline  
Pureghetto
Itadakimasu~
Pureghetto's Avatar
Location: Barrie, ON
Talking

Originally Posted by crono_logical ^
what OS you trying it on? syntax may vary, but that works in cygwin for me
windows xp ?
Old 07-21-2008, 08:51 PM
Reply With Quote
Pureghetto is offline  
Post New Thread  Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0
Copyright ©2000 - 2007, Eyes on Final Fantasy.
Sean Robinson Design