#1 2010-11-15 21:02

PoppinJ
Member
Registered: 2010-11-15
Posts: 4

Author form Auel, A. A. to A. A. Auel

So I know nothing about this stuff but researched really hard to try and figure it out but im stumped. I'm renaming all the files in my library from (last name), (first name) to (First name) (Last Name) but am having difficulty with certain files. I can currently manage about 90 percent of them with
RegEx (.+?\S) (.*) and $2 $1.
This changes all of the to (last), (first) and even (last), (first) (middle init.) the the format i want of (Fist) (Middle) (Last), then another rule to remove the comma. The problem is with Authors such as Attanasio, A.A or Attanasio A. A. These files turn into A. Attanasio,.A. Is there any way around this or do I have to manually change these files. I don't know if there is one command that would work for everything at once or not. They are mixed all together so going through and manually selecting them would be difficult and defeat the convenience of this wonderful program. Perhaps 2 separate operations or something.

Last edited by PoppinJ (2010-11-15 21:50)

Offline

#2 2010-11-15 23:31

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Author form Auel, A. A. to A. A. Auel

Hi PoppinJ, welcome.

I think in general you have to find an common pattern for all files to match the wanted parts,
or you have to select only the files with an common pattern and rename them first, then select the next files...
... but this selection could be done by an script (ReNamer use PascalScript)

So what is the common pattern to match the last name?

Taking your examples
the rule 1 would be "all before an coma is the last name"
FROM:
last name, first name
last, first middle
Auel, A. A
TO:
first name last name
first middle last
Auel A. A.


and the rule 2 "if there is no coma at all, take only the first word as last name"
Rule 2
FROM:
Attanasio A.A
TO:
Attanasio A.A

So one could write an script like:
- take filename
- IF  there is an coma found THEN "move all before an coma to the end"
- ELSE "move the first word to the end"

Are this all possible pattern of your files,... or are there even more?


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2010-11-16 02:39

PoppinJ
Member
Registered: 2010-11-15
Posts: 4

Re: Author form Auel, A. A. to A. A. Auel

There is always a last name followed by a comma. If there is no coma then I dont want the folder renamed. The next thing following the coma is always the first name, but sometimes is only an initial. The next thing is always the middle name, but again is sometimes an initial. Some examples of what I have is,


Smith, John Golf
Smith, John G.
Smith, J. Golf
Smith, J. G.
Smith, J G
Smith, J. G

This is how 98 percent of the files are formatted. There are some exceptions that would be nice if they could fit in but I would expect to have to handle them manually. Rarely there is something like

Smith, J.G                       (no space between 1st and middle but a period) or
Smith, John G. Teller        (4 Parts)

I know nothing about scripting though so I dont know where to start. What I finally want is John G. Smith or J. G. Smith. I know how to get a period behind each initial if I can just get all parts of the name in the correct spot.

Also, while renaming I sometimes notice 2 original files such as Smith, J. G. and Smith, J.G. The are supposed to be the same file obviously but because of the space or whatever they are separate. If I rename both files to J. G. Smith it will throw an error because the path already exists. Is there a way to rename them both the same thing then have them merge the contents of the files while renameing? Just curious. Thanks.

Offline

#4 2010-11-16 08:45

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Author form Auel, A. A. to A. A. Auel

PoppinJ wrote:

There is always a last name followed by a comma.

Then it's easy.

There are some exceptions

Smith, J.G                       (no space between 1st and middle but a period) or
Smith, John G. Teller        (4 Parts)

That doesn't matter.
We just search for everything till an coma, then for the rest, then we swap this.



I have tried this:


FROM:
Smith, John Golf.ext
Smith, John G..ext
Smith, J. Golf.ext
Smith, J. G..ext
Smith, J G.ext
Smith, J. G.ext
Smith, J.G.ext
Smith, John G. Teller.ext

TO:
John Golf Smith.ext
John G. Smith.ext
J. Golf Smith.ext
J. G. Smith.ext
J G Smith.ext
J. G Smith.ext
J.G Smith.ext
John G. Teller Smith.ext


Therefor i have two solutions in mind which both seams to work:

1)
Rearrange: Split by delimiters ", ", New pattern "$2 $1" (skip extension) (( search for an coma followed by an space))
and
2)
RegEx: Replace expression "(.+),\s*(.+)" with "$2 $1" (skip extension) (( search for an coma followed by an space or not))


Also, while renaming I sometimes notice 2 original files such as
Smith, J. G. and
Smith, J.G. 
If I rename both files to J. G. Smith it will throw an error because the path already exists.

You can add an serialized number to the next file with the same name, see f.ex. "Options > Fix conflicting New Names"
>>> http://www.den4b.com/forum/viewtopic.php?id=869


HTH?  big_smile ... if you have more questions just ask, someone will help you.


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#5 2010-11-16 18:40

PoppinJ
Member
Registered: 2010-11-15
Posts: 4

Re: Author form Auel, A. A. to A. A. Auel

Thanks for the help. The files are still not renaming quite correctly, and I'm wondering if something strange is going on. Im honestly not sure how to use the first solution you posted as I cannot find the "rearrange" rule. Using the RegEx you posted most rename correctly but some do not. Some direct examples include

Andrews, V.C
Ansay, A. Menette

to

V Andres.C
A. Ansay. Manette

All the file names with a period in them rename incorrectly. If there is no period in the original file name then it works out perfect.
I cant seem to get rid of the periods either. I used the rule cleanup-replace with spaces .(dot) and Fix Spaces. The periods stay in the new file name.

Edit: I downloaded the beta version of renamer which has teh rearrange feature on it. It yields the same results. Something weird is going on with the periods in the file names.

Last edited by PoppinJ (2010-11-16 19:15)

Offline

#6 2010-11-16 19:37

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Author form Auel, A. A. to A. A. Auel

Sorry for the Rearrange-Rule issue, i do always that mistake not thinking about beta ;-)

And related to the dot: i guess you want to say that "V Andres.C" is wrong for you? Or is this the result you want now to get?

That's an issue with extensions it seams, ReNamer takes all behind the last dot as extension.

So help me: Do you now want to rename files (as mentioned in first post) with extensions
or folder without extension (as mentioned today)?

If you have no extension try un-checking "Skip Extension" for that rules in question.

Test

1) RegEx: Replace expression "(.+),\s*(.+)" with "$2 $1"  --- (skip extension is un-checked)

FROM:
Smith, John Golf
Smith, John G.
Smith, J. Golf
Smith, J. G.
Smith, J G
Smith, J. G.
Smith, J.G.
Smith, John G. Teller
TO:
John Golf Smith
John G. Smith
J. Golf Smith
J. G. Smith
J G Smith
J. G. Smith
J.G. Smith
John G. Teller Smith

.

Last edited by Stefan (2010-11-16 19:42)


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#7 2010-11-16 19:41

PoppinJ
Member
Registered: 2010-11-15
Posts: 4

Re: Author form Auel, A. A. to A. A. Auel

I am renaming folders, sorry about stating files in the original post. Unchecking skip extensions solves the problem. Everything is working out great now. 5649 files renamed. smile

Last edited by PoppinJ (2010-11-16 19:43)

Offline

Board footer

Powered by FluxBB