Forum Home
PC World Chat
 
Thread ID: 118347 2011-05-31 16:04:00 Search w/ Replace Options SurferJoe46 (51) PC World Chat
Post ID Timestamp Content User
1205941 2011-05-31 16:04:00 How would anyone tell me the way to remove the spurious garbage in these sample listings?


ABBA\Gold- Greatest Hits\10 S.O.S.wma" "{4CED4F90-848C-4721-BA9C-3873DE78E1F9}" tid="{035859ED-0D4A-4D40-A0CF-B7E826C4E645}"/>
ABBA\Gold- Greatest Hits\11 Chiquitita.wma" "{3F6E62D4-9103-4A6C-9B65-2BF80C55A396}" tid="{1D056C8D-74D5-4F05-A3DB-77A87C0D1F0D}"/>
ABBA\Gold- Greatest Hits\12 Fernando.wma" "{0B347A08-605F-41B0-9FB5-0251F617A13D}" tid="{881918B6-460E-413C-A22C-32935AD9E12A}"/>
ABBA\Gold- Greatest Hits\13 Voulez-Vous.wma" "{9686BA5B-47D3-49B0-A200-05619BF7DC99}" tid="{02A035D1-C0C1-4E4F-8344-8ED311CEACC8}"/>

I want the stuff in brackets and BOLDed removed, but Search/Replace won't allow wild cards. Do I have to redact them each individually?
SurferJoe46 (51)
1205942 2011-05-31 21:10:00 Notepad++'s regular expressions will help you here :thumbs: pcuser42 (130)
1205943 2011-05-31 22:50:00 I am using Open Office - and it has the GUI - but what in the world is Word ++ ? SurferJoe46 (51)
1205944 2011-05-31 23:05:00 I just tried M$ Wordpad and Notepad - and Notepad sends up a note that says it has had a fatal error and needs to close - and please tell Uncle Bill about this problem.

Needless to say - I'll keep Uncle Bill in the dark.

But it appears neither of them can do wild card searches nor get wildcard results.

I used * and % - but if you know a different wildcard, let me know.
SurferJoe46 (51)
1205945 2011-06-01 00:33:00 Maybe try a online tool like sugar script (www.sugarscript.com). First select drop down in example box which has many options (e.g. html tags). The tool then auto adds the expressions.Then paste your text in the box below to convert. It will strip out what's not required, but trial and error I guess.

SourceForge also has s/r text tools. I can't recall the name of another online tool that I use to use for converting text codes to regular expressions, but a few about online.
kahawai chaser (3545)
1205946 2011-06-01 00:48:00 I am using Open Office - and it has the GUI - but what in the world is Word ++ ?

http://notepad-plus-plus.org

Open the file in Notepad++, then press Ctrl+H to do a Find and Replace. In the Find What box, type something along the lines of this:


cid="{.*}"

(based on the contents of my WMP12 playlists)

The .* will select everything between the first { and the last } on a line.

Make sure the regular expression radio button is selected or it won't work!
pcuser42 (130)
1205947 2011-06-01 01:11:00 http://notepad-plus-plus.org

Open the file in Notepad++, then press Ctrl+H to do a Find and Replace. In the Find What box, type something along the lines of this:


cid="{.*}"

(based on the contents of my WMP12 playlists)

The .* will select everything between the first { and the last } on a line.

Make sure the regular expression radio button is selected or it won't work!

OK - I don't see a radio button - and I tried the expression "{*}" and it tells me the string isn't valid.

OK - I found the radio button and it still tells me the string isn't valid.
SurferJoe46 (51)
1205948 2011-06-01 01:16:00 Now I tried to C/P just one line and I get it telling me it cannot be found.

It has to be found as I Copy/Pasted it directly from the text into the SEARCH bar.

Now what?
SurferJoe46 (51)
1205949 2011-06-01 01:58:00 sed 's/\" \"{.*$//' original.txt > result.txt
or if you want to keep the trailing " after .wma

sed 's/ \"{.*$//' original.txt > result.txt
fred_fish (15241)
1205950 2011-06-01 02:06:00 OK - I found the radio button and it still tells me the string isn't valid.

Don't forget the full stop before the asterisk.

Also you might want to remove cid= - it shows up in my WMP12 playlist but I noticed it didn't appear in your original post.
pcuser42 (130)
1 2