Batch text file editing

Afro000Dude

Senior member
Feb 6, 2003
746
0
0
So I have a bunch of text files (song lyrics downloaded by a winamp plugin) and a majority of them are formatted in a way I don't like. The two biggest issues are capitalization and a problem with apostrophes showing up as question marks. For example I want

it?s the same every day and the wave won?t break

to say

It's the same every day and the wave won't break

Is there a way to do this for ~2500 files easily?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Google "grep"

replace \?s with \'s (\=escape, I forget whether ' needs one)

Download.com should also have some search-and-replace tools
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
EditPlus is a text editor that has a great multi-file find and replace feature (with regex support). Problem is you need to differentiate between question marks you want to keep and the ones you want to replace - only way I can think of is to not replace the ones at the end of lines (which you could write a regular expression for)
 

Afro000Dude

Senior member
Feb 6, 2003
746
0
0
Originally posted by: mugs
EditPlus is a text editor that has a great multi-file find and replace feature (with regex support). Problem is you need to differentiate between question marks you want to keep and the ones you want to replace - only way I can think of is to not replace the ones at the end of lines (which you could write a regular expression for)

That's exactly the problem I was having. I ended up using UltraEdit to change all question marks followed by a newline to #$%, then changing all other ?'s to apostrophes, then changing the #$%'s back to ?'s. So that's one problem down.

Do any of these tools have a way to just capitalize the first letter of each line? I may just end up using the start-of-line character followed by each letter individually...