ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

"Renaming" a list of names (not files)

<< < (3/3)

tomos:
Here's some AHK code to do what you want.  Simply copy your text to the clipboard and run this script.  The modified output will be copied back out to your clipboard.  Alternately, this snippet could easily be modified into a hotkey.
-skwire (January 11, 2010, 03:22 AM)
--- End quote ---

saved [edit] I meant I saved the script! [/edit], thanks Skwire :up: will get back to you/this later

AbteriX:
Yes Notepad++ will do

Notepad++  (freeware)
http://notepad-plus.sourceforge.net/de/download.php
http://sourceforge.net/projects/notepad-plus/files/
Find: (.+) (.+)
Repl: \2 \1
[X] Regular Expression


Notepad2  (freeware)
http://www.flos-freeware.ch/notepad2.html
Find: \(.+\) \(.+\)
Repl: \2 \1
[X] Regular expression search


Boxer
Find: (.+) (.+)
Repl: $2 $1
[X] Perl regular expressions
[X] Process $1, $2...



HippoEDIT (find an discount post at DC forum)
Find: (.+) (.+)
Repl: $2 $1
[X] Regular Expression


PlainEdit (freeware)
http://www.gaijin.at/dlplainedit.php
Find: ^(.+?) (.+?)$
Repl: $2 $1
[X] Regular Expression
[X] Ersetzen mit Escape-Zeichen
Note: PlainEdit search is very greedy, so i have to subdue the RegEx term

tomos:
Well, progress indeed :D all methods working :up:

First with RegEx:
I downloaded both Notepad++ & 2 (in portable formats) and tried both
It's like magic - zap zap & everything's reversed  :Thmbsup:  I swear I was staring at the screen with my mouth open :O

Tom Jones Singer
becomes
Singer Tom Jones
+
Jones Singer
becomes
Singer Jones


I also wanted to strip out the last part (so I would be left with the singer's name in the above examples)
so, in Notepad++

Find: (.+) (.+)
Replace: \1
worked a treat


I can see why people like regular expressions - thanks for all the help again people
=============================================================

Skwire, that script works perfectly too :Thmbsup: - I was initially getting error messages, but because I did a 'save as' from the copy or paste box :-[ which of course was html...
I will use both methods as I'm getting bits of lists sent to me in dribs & drabs & I need to be able to sort (again using the example above) by 'Name' and by 'Occupation'

f0dder:
Regular expressions can do a lot of nice stuff, and get complex text manipulation over and done with in a jiffy - they're pretty darn nice. Just don't try and go do silly things like parse HTML with regex :)

IainB:
@tomos: Sorry - I should have said that you don't need to use Excel. The string handling works just fine in Google Docs spreadsheet also and probably would in Open Office spreadsheet (though I have not tried that).

If this were a regular chore that I needed to do, then I would automate it and retain the work as separate sheets in a workbook using something like Excel/Google spreadsheet.

The other suggestions in this discussion look like more fun, but seem a tad overly complicated for easy repetitive automation of such a basic task.

(Heh. I had to stop myself from suggesting you use string handling routines in Fortran.)       ;D

Navigation

[0] Message Index

[*] Previous page

Go to full version