Welcome Guest.   Make a donation to an author on the site April 24, 2014, 05:31:07 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2010! Download 24 custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA:two options text manipulation tool  (Read 2303 times)
rapstar
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« on: May 17, 2011, 11:39:51 AM »

Hey, i need a simple tool which manipulates text strings. Two options are crucial: a) add needed text in the beginning of each line and b) replace everything from text to find till the end of the line with desired text.

I guess this could be done in like notepad++ with regexps but i failed to make an expression.

My strings are like
Quote
mp3search.com/search.php?artist=Janis+Joplin
and i need to add http:// in the beginning of each line and replace from artist= till the end of string with what i want... used to work manually, bit here come thousands of 'em  undecided

« Last Edit: May 17, 2011, 11:43:49 AM by rapstar » Logged
skwire
Moderator
*****
Posts: 3,912



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: May 17, 2011, 12:05:59 PM »

Do you already have a list of artists you want to search?
Logged

mouser
First Author
Administrator
*****
Posts: 32,701



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: May 17, 2011, 03:31:39 PM »

Many clipboard tools can do this kind of thing, including my Clipboard Help+Spell.  They are a bit overkill if you don't need the clipboard and text formatting features regularly.

ps. Thumbs up for Janis Joplin, one of the greats  thumbs up
Logged
skwire
Moderator
*****
Posts: 3,912



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: May 17, 2011, 03:39:23 PM »

I was going to offer my ListNumberer app as a way to do what he wants.  He can just paste in his list of search terms and then use "http://mp3search.com/search.php?artist=" as a prefix.
Logged

cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,158



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: May 17, 2011, 04:27:26 PM »

I was going to offer my ListNumberer app as a way to do what he wants.  He can just paste in his list of search terms and then use "http://mp3search.com/search.php?artist=" as a prefix.

And a very nice app it is too.  thumbs up thumbs up    (Just the job for this task.)
Logged

Chris
rapstar
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #5 on: May 19, 2011, 01:01:41 PM »

list numberer worked like a charm when i needed to add the same string to the beginning

*except it looks weird if you put like 140% scale in your win xp

for my second replacement need, it's no just adding things in the end, i need to search for given expression and then replace everything till the end of the line, expression itself included

actually it's not like search.php?artist= in the end, url i get from parsing are like
Quote
search.php?artist=Patti+Smith&onetwo=true&areyousure=yes&hash=5655434&clientid=12343&
so i want to get rid of unnesessary paremeters

going to try Clipboard Help+Spell, many thanks
« Last Edit: May 19, 2011, 01:15:11 PM by rapstar » Logged
Jibz
Developer
***
Posts: 856



Cold Warrior

View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: May 19, 2011, 01:41:23 PM »

I don't know if I understood exactly what you wanted to replace, but in Notepad++ maybe something along the lines of replace
[copy or print]
([^\?]+)\?([^&]+).*
with
[copy or print]
http://\1?\2
(make sure regular expression is ticked).

I.e. grab everything up to the first ? on the line and store that in \1, grab everything after that and up to the first & and put that in \2, match the rest of the line to get that removed.
Logged

"A problem, properly stated, is a problem on it's way to being solved" -Buckminster Fuller
"Multithreading is just one damn thing after, before, or simultaneous with another" -Andrei Alexandrescu
MilesAhead
Member
**
Posts: 4,468



View Profile Give some DonationCredits to this forum member
« Reply #7 on: May 19, 2011, 02:01:08 PM »

There are many editors that can use either regular expressions as Jibz noted, or their own symbolic pattern characters, that can replace pattern with text or include the pattern in the replacement.  Although you tend to encounter them more on other OS.  Windows freeware editors tend to be more limited.

You may want to try one of the Windows ports of vi. That editor can do some amazing things in command mode if you don't mind jumping in and out of edit mode.  Can make you a bit schizoid but if you are really into complicated editing you may not mind. smiley

I never got really adept at vi but when I was playing with Linux a lot I used it enough to start to see the versatility.
« Last Edit: May 19, 2011, 02:02:57 PM by MilesAhead » Logged

"I don’t want to belong to any club that would have me as a member."
 - Groucho Marx

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.032s | Server load: 0.01 ]