• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Batch text file editing

Afro000Dude

Senior member
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?
 
Google "grep"

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

Download.com should also have some search-and-replace tools
 
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)
 
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...
 
Back
Top