How/What Program Would You Use To Do This

AdHustler

New member
Aug 24, 2007
4,377
44
0
Lets say you had a repeating string of text like this

[blah blah - $12][blah blah blah - $45][blah blah blah jah - $20][horse - $9]

In the string i want to remove " - $*" so the text looked like

[blah blah][blah blah blah][blah blah blah jah][horse]

Other then breaking it apart painstainkingly with excel formulas is there a text editing program that can easily do this by doing a search for a wildcard like " - $*"

I figured notepad++ could do it but i cant figure it out if it can.
 


Any text editor with regex support would be my choice (NP++ probably has this), although I suck at writing regexes.
 
even notepad can do it. Just open your text file in notepad and press Ctrl + H. Fill special characters in "Find What" field and leave the "Replace with" filed blank and click "Replace All" and you are done.

Do it one by one with every special character you want to remove and you will remain with clean string.

Steps:-
1. Open your file in notepad
2. Press Ctrl + H
3. Fill the special character in "Find What" and Leave the "Replace with" filed blank
4. Click "Replace With"
5. Loop 1 to 4 for every character until you left with clean string you want.

although I guess you also need to remove spaces too.
 
You can actually use Excel :)

Paste your text into excel. Then press Ctrl H

For find wat box: - $*] <<<< make sure y ou got the space after the :
Replace with:]

Simple as that.
 
These two regular expression mode replace all with blank in Notepad++ did it for me.

- $[0-9]
- $[0-9][0-9]

It could probably be done in one, but I am not sure how.
 
This worked for me in NP++ on the example you gave, use regex mode:

[-\s]+[$]\d+
 
sed, grep, and awk, and you are done! Simple as that. Even vi would do it without much difficulty.
 
I tried NP++ for awhile but didnt like it as much as EditPadPro, which works great for stuff like this, as well as for any sort of text editing. Also RegexBuddy by the same company (jgsoft) is really awesome when you need to figure out more complex regex patterns. Both well worth the money.