INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How do I "trim" items from "Name" field using Rename, Move & Copy?  (Read 6455 times)

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007

Morning,

I have a few old rips that I am trying to clean up using MC. One was done years ago and for whatever reason has following fields 'combined" in the "name" field of the track:

[Name] - [Artist]

I am looking to use Rename, Move and Copy to trim the "- [Artist]" part off of the name so I can get it into my usual structure of:

[Artist]\[Album]\[Track#] [Name]

I continue to be baffled as to how to use RM&C to trim parts of the name field off and have had to fall back to using Tag N' Rename to do this since I can use it's "%d" placeholder to simply ignore a selected pattern.

So for this specific example - with current the file names set to:

[Track#] - [Name]

I can use Tag N' Rename with it's "Get Tags from Filename" feature and apply a pattern of %d - %2 . A quick run of this and the Name (Title) field is immediately filled (and trimmed) correctly. Surely there must be a way to do this in MC16?

Any help would be most appreciated.

Cheers!

VP
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #1 on: August 19, 2011, 09:16:46 am »

Morning,

I have a few old rips that I am trying to clean up using MC. One was done years ago and for whatever reason has following fields 'combined" in the "name" field of the track:

[Name] - [Artist]

I am looking to use Rename, Move and Copy to trim the "- [Artist]" part off of the name so I can get it into my usual structure of:


Try this: Select the files you want to edit. Click rename on the name field, then enter this Expression:

=RemoveCharacters([Name], - [Artist],2)

It should remove the - [Artist] info from the name tag. Be sure to backup first and do a small test sample first  ;D
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #2 on: August 19, 2011, 09:29:41 am »

Try this: Select the files you want to edit. Click rename on the name field, then enter this Expression:

=RemoveCharacters([Name], - [Artist],2)

It should remove the - [Artist] info from the name tag. Be sure to backup first and do a small test sample first  ;D

Hmm, further testing has produced some problems. Sometimes additional characters are being removed, but I'm not sure exactly why. Any of you expressions wizards have an explanation?

I do get predictable results if I break it down into steps:

=RemoveCharacters([Name],[Artist],2)

This removes the Artist name

=RemoveCharacters([Name], - ,2)

This removes the hyphen and the additional spaces.

Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #3 on: August 19, 2011, 09:30:24 am »

Try this: Select the files you want to edit. Click rename on the name field, then enter this Expression:

=RemoveCharacters([Name],- [Artist],2)

It should remove the - [Artist] info from the name tag. Be sure to backup first and do a small test sample first  ;D

Thanks - but this is clipping some characters off of the actual name now. And it's not consistent either...sometimes it clips one character of the end and other times more?

Also - can I use this to "bulk" rename? One at a time is a bit of a chore...

Cheers,

VP
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #4 on: August 19, 2011, 09:34:27 am »

Thanks - but this is clipping some characters off of the actual name now. And it's not consistent either...sometimes it clips one character of the end and other times more?

Also - can I use this to "bulk" rename? One at a time is a bit of a chore...

Cheers,

VP

See my response to my original post. It solves the clipping problem, at least in all my tests.

This works in bulk; you can select as many tracks as you want before clicking rename. It's two steps now instead of one, but you can do all the tracks at once if you like.
Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #5 on: August 19, 2011, 09:47:14 am »

See my response to my original post. It solves the clipping problem, at least in all my tests.

This works in bulk; you can select as many tracks as you want before clicking rename. It's two steps now instead of one, but you can do all the tracks at once if you like.

Thanks! But if I can't go in a single step and (Most importantly) do it within in the RM&C module (rather than messing around in the grid) - I will probably stay with T&R in these cases...it's lightning fast and does it all in a single click.

I should also mention that all these kinds of edits are happening to files "outside" of the MC library - I am accessing the files via Drives and Devices->Explorer area on the Tree.

Cheers,

VP

Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #6 on: August 19, 2011, 09:47:56 am »

wig solution is good. mc has more options to get to the same goal.. i would have tried this
Code: [Select]
=ListItem([name],0,-)
 :)
gab
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #7 on: August 19, 2011, 09:53:03 am »

wig solution is good. mc has more options to get to the same goal.. i would have tried this
Code: [Select]
=ListItem([name],0,-)
 :)
gab

That's a one step solution, so it's clearly better.

Any ideas why my original expression =RemoveCharacters([Name], - [Artist],2) was removing additional characters in some strings?
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #8 on: August 19, 2011, 10:01:14 am »

i have no idea.. cant reproduce it on the few files i tested with.. do you have an example?

 :)
gab
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #9 on: August 19, 2011, 10:11:08 am »

i have no idea.. cant reproduce it on the few files i tested with.. do you have an example?

 :)
gab

We Can Work It Out - Stevie Wonder becomes We Can Work It Ou

Here Comes the Sun - Richie Havens becomes Here Comes the Su

Not a Second Time - Robert Palmer becomes Not a Second Ti
Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #10 on: August 19, 2011, 10:14:31 am »

We Can Work It Out - Stevie Wonder becomes We Can Work It Ou

Here Comes the Sun - Richie Havens becomes Here Comes the Su

Not a Second Time - Robert Palmer becomes Not a Second Ti

I think within this construct:

([Name], - [Artist],2)

the "2" is actually backing up and removing either the space and the first char (if a space is present) or the last 2 chars (if no space)

VP
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #11 on: August 19, 2011, 10:19:59 am »

i thik it will remove all the charcters from the end that are in the charcters to remove part.
with time.. the 'me' is part of 'robert palmer' the i is not in his name, and that is where the expression stops removing characters (when using 2) ?.. i think with the examples you gave its the nature of the expression.

 :)
gab

actualy just tried
Weet Steen onder - Stevie Wonder from Stevie Wonder
(made that up)
and the whole name will disappear.. so that is how it works i think
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #12 on: August 19, 2011, 10:28:14 am »

I think within this construct:

([Name], - [Artist],2)

the "2" is actually backing up and removing either the space and the first char (if a space is present) or the last 2 chars (if no space)

VP

According to the JRiver expression guide, the "2" identifies the mode to only remove the characters from the end of the string.

Here are a couple more drastic examples.

With the Artist Celtic Christmas

Oh Little Town of Bethlehem - Celtic Christmas becomes Oh Little Town of B

Silver Bells - Celtic Christmas becomes Silver B

The Twelve Days of Christmas Celtic Christmas becomes The Twelve Days of

Disclaimer - This is wretched music, please don't try and listen to it


Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #13 on: August 19, 2011, 10:31:40 am »

According to the JRiver expression guide, the "2" identifies the mode to only remove the characters from the end of the string.

and it does in these examples to.. it sees the characters as seperate items, and will remove from the end till there is a character that is not in the list, in this case characters using - [artist]. ansd it also explains why the two step way did work.  :)
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #14 on: August 19, 2011, 10:38:52 am »

and it does in these examples to.. it sees the characters as seperate items, and will remove from the end till there is a character that is not in the list, in this case characters using - [artist]. ansd it also explains why the two step way did work.  :)

Ok, that makes sense now. In the two step process the hyphen actually shields the rest of the name from removal during step one.

I'm smarter now, I think.
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #15 on: August 19, 2011, 10:41:10 am »

Ok, that makes sense now. In the two step process the hyphen actually shields the rest of the name from removal during step one.

I'm smarter now, I think.
:P me too. had not played with the removecharacter before.  :)
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #16 on: August 19, 2011, 10:52:38 am »

The field [Artist] is first expanded into its value, and this creates a list of characters for removal, so your expression:

([Name], - [Artist],2)

becomes

([Name], - Celtic Christmas, 2)

which is equivalent to:

([Name], - Cacehilmrst, 2)

So it removes any character from the list "- Cacehilmrst" of characters from your track names.



Oh Little Town of Bethlehem - Celtic Christmas ==>
  Oh Little Town of B  (we see that e,t,h,l, and m were removed as expected)

Silver Bells - Celtic Christmas ==> Silver B (same thing here e, l, and s were removed)

The Twelve Days of Christmas Celtic Christmas ==> The Twelve Days of (same thing here as above)
Logged
The opinions I express represent my own folly.

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #17 on: August 19, 2011, 11:25:05 am »

The field [Artist] is first expanded into its value, and this creates a list of characters for removal

The next logical question; is there any way to preserve the [Artist] phrase? None of my experiments with quotes worked.
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #18 on: August 19, 2011, 11:39:58 am »

Great explanation MrC.

I was playing with this very thing a couple of days ago, when trying to remove the junk from the titles of shows recorded with WMC.

I get stuff like Friends_KLRUTV3_08_59_00_13

which treats each one different than other episodes with different dates.

I ended up using the removecharacters expression to remove all of the capital letters, numbers and "_" from the end of the filename (using the ,2 switch).

it took a little playing but I now see all of my recorded shown automatically trimmed down to just the real show name; "Friends" in this case, and it will group them properly now, so clicking on Friends will expand to show all episodes of Friends.

it works well.  I had some issues with NOVA, since it was all capital letters also, so I had to add some if() statement to the expression, and use it along with the leftcharacters() expression to get this exception 'fixed' but it's all working great now.

I'll post up details later, but mainly wanted to add that the removecharacters *does* treat capital letters different than lower case, as MrC described.

...so your expression:

([Name], - [Artist],2)

becomes

([Name], - Celtic Christmas, 2)

which is equivalent to:

([Name], - Cacehilmrst, 2)

So it removes any character from the list "- Cacehilmrst" of characters from your track names.

because "- Cacehilmrst" is really just a list of the unique characters from the original.

- Celtic Christmas  ===> ' -Celtichrsma' which becomes ' -Cacehilmrst' (shown alphabetically)

then, as he said, it will remove those letters from then end of the [Name]

I'm not sure where MC decides the 'beginning' and the 'end' are defined.

in other words, in my experience it will remove all the capital letters I entered, even if they show up multiple times, with other letters in between, but not if it's the first letter.

I don't know if there's a "mid-point" that it stops eliminating letters from the 'end'.

Specifically, why does it only remove letters like this, and not all the t's for example.  What stops it at the Capital B?

Oh Little Town of Bethlehem - Celtic Christmas ==>
  Oh Little Town of B  (we see that e,t,h,l, and m were removed as expected)
Logged
pretend this is something funny

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #19 on: August 19, 2011, 11:45:20 am »

The next logical question; is there any way to preserve the [Artist] phrase? None of my experiments with quotes worked.

Fields will be expanded into their values inside a function, and any characters in argument 2 of RemoveCharacters are just a list of characters to remove.

A little bird says you should wait for a short while...

Currently you can break the portions apart using the ListItem() solution.

Logged
The opinions I express represent my own folly.

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #20 on: August 19, 2011, 11:48:30 am »

I have a few old rips that I am trying to clean up using MC. One was done years ago and for whatever reason has following fields 'combined" in the "name" field of the track:

[Name] - [Artist]

I am looking to use Rename, Move and Copy to trim the "- [Artist]" part off of the name so I can get it into my usual structure:

I don't think all this is necessary to do just this.

If your filename is/contains "Enter Sandman - Metallica.flac" for example, you can just use the fill properties from filename to quickly do this with this "[Name] - [Artist]" in the filename box.

this will put Enter Sandman in the Name field and Metallica in the Artist Field.  if you're sure the Artist field is already correct, then you could just use

"[Name] - " to put just Enter Sandman into the name (the ' - ' will be how you tell it where the [Name] field ends in the actual filename.  It will then ignore the Metallica part of the filename

if your filename is not as above, you can rename it (move, copy, rename) using the "wrong" name field, to get the filename to also be "wrong" which will then allow you to do this as described above to correct it.

You can test on one file, but you can select any number of files to do this action to all of them at the same time.

I would test a couple first; after a backup.

good luck.
Logged
pretend this is something funny

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #21 on: August 19, 2011, 11:52:21 am »

I don't know if there's a "mid-point" that it stops eliminating letters from the 'end'.

Specifically, why does it only remove letters like this, and not all the t's for example.  What stops it at the Capital B?

Oh Little Town of Bethlehem - Celtic Christmas ==>
  Oh Little Town of B  (we see that e,t,h,l, and m were removed as expected)

It would appear that the first non-match terminates.
Logged
The opinions I express represent my own folly.

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #22 on: August 19, 2011, 11:53:34 am »

It would appear that the first non-match terminates.

Okay, yeah, that makes sense.  Great!  Thanks again.  :D
Logged
pretend this is something funny

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #23 on: August 19, 2011, 12:01:16 pm »

I don't think all this is necessary to do just this.

If your filename is/contains "Enter Sandman - Metallica.flac" for example, you can just use the fill properties from filename to quickly do this with this "[Name] - [Artist]" in the filename box.

this will put Enter Sandman in the Name field and Metallica in the Artist Field.  if you're sure the Artist field is already correct, then you could just use

"[Name] - " to put just Enter Sandman into the name (the ' - ' will be how you tell it where the [Name] field ends in the actual filename.  It will then ignore the Metallica part of the filename

if your filename is not as above, you can rename it (move, copy, rename) using the "wrong" name field, to get the filename to also be "wrong" which will then allow you to do this as described above to correct it.

You can test on one file, but you can select any number of files to do this action to all of them at the same time.

I would test a couple first; after a backup.

good luck.

Hmm...will try this. But I recall it not working in the past. Maybe time to give it another whirl!

Cheers,

VP
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #24 on: August 19, 2011, 11:20:11 pm »

Hmm...will try this. But I recall it not working in the past. Maybe time to give it another whirl!

I hope it works better for you this time :)

...trying to remove the junk from the titles of shows recorded with WMC.

I get stuff like Friends_KLRUTV3_08_59_00_13

which treats each one different than other episodes with different dates.

I ended up using the removecharacters expression to remove all of the capital letters, numbers and "_" from the end of the filename (using the ,2 switch).

it took a little playing but I now see all of my recorded shown automatically trimmed down to just the real show name; "Friends" in this case, and it will group them properly now, so clicking on Friends will expand to show all episodes of Friends.

it works well.  I had some issues with NOVA, since it was all capital letters also, so I had to add some if() statement to the expression, and use it along with the leftcharacters() expression to get this exception 'fixed' but it's all working great now.

I'll post up details later...

Here is how I ended up accomplishing this name display "magic" for these recordings.

The expression I used is...

Code: [Select]
if(isequal(left(TVInfo(SeriesDisplay),4),NOVA),NOVA,removecharacters(removecharacters(TVInfo(SeriesDisplay),0123456789_,2),AKLRUWFOCDTVN_,2)
which basically says, if the leftmost 4 characters of the TVInfo(SeriesDisplay) field/expression = NOVA, then show NOVA, otherwise, remove all the numbers and _ from the end of the file, then remove the letters and _ from the resulting name.

I can't remember exactly why I had to put one removecharacters() inside the other, but it solved some display quirk I had when I just listed everything in one longer list.

As you can see below, the results are perfect.  Here is how it handles these 2 NOVA episodes and all the Friends episodes. (notice the original names below the thumbs)


Logged
pretend this is something funny

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #25 on: August 19, 2011, 11:45:07 pm »

Nice to get things worked out.

Note also you can use ListItem() to pull apart pieces of a string.  Since your series names are of the forms:

   name_blah_blah_blah

if you think of an underscore as a separator character, you can just grab the first item (I've number the index number under the series name):

   name_blah_blah_blah
      0       1     2     3

Note that index 0 is the first item.

=ListItem(TVInfo(SeriesDisplay), 0, _)
Logged
The opinions I express represent my own folly.

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #26 on: August 20, 2011, 05:00:45 am »


Note also you can use ListItem() to pull apart pieces of a string.  Since your series names are of the forms:


This is great. I have a bunch of sampler albums where the Name is [Name] - [Artist] and the Artist is Various Artists.

Now I can use =ListItem([name],1,-) in the Artist Field to extract that info to it's correct position. Quite the time saver!
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #27 on: August 20, 2011, 11:58:07 am »

This is great. I have a bunch of sampler albums where the Name is [Name] - [Artist] and the Artist is Various Artists.

Now I can use =ListItem([name],1,-) in the Artist Field to extract that info to it's correct position. Quite the time saver!

True, but if they are all called [Name] - Various Artists, you could simply do a find replace on the [Name] field, and replace " - Various Artists" with "" (nothing) and it would simply remove " - Various Artists" from the name field (or any field you selected, including filename, if your files are actually named 'incorrectly' also).

Nice to get things worked out.

Note also you can use ListItem() to pull apart pieces of a string...

yes it is :)

Yes, that is a better solution for me I think.  I don't think I'll change what I have already, just because it does work, but in the future, the ListItem() expressions looks better when there is a consistent 'separator'.

thanks again.
Logged
pretend this is something funny

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #28 on: August 22, 2011, 09:46:45 am »

I don't think all this is necessary to do just this.

If your filename is/contains "Enter Sandman - Metallica.flac" for example, you can just use the fill properties from filename to quickly do this with this "[Name] - [Artist]" in the filename box.

Justin,

Just an update here for you - finally had a chance to revisit this and now I remember why it won't work. The file name for me was not the problem. It was the actual [Name] field when these files are loaded into MC. So to stay with your example:

Actual Windows Filename could be: 01 - Enter Sandman.flac
Name (as display when loaded into MC) is : Enter Sandman - Metallica

Using Fill Properties from Filename here is of no use since the Artist name is not part of the file name.

Cheers,

VP
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #29 on: August 22, 2011, 12:34:37 pm »

Justin,

Just an update here for you - finally had a chance to revisit this and now I remember why it won't work. The file name for me was not the problem. It was the actual [Name] field when these files are loaded into MC. So to stay with your example:

Actual Windows Filename could be: 01 - Enter Sandman.flac
Name (as display when loaded into MC) is : Enter Sandman - Metallica

Using Fill Properties from Filename here is of no use since the Artist name is not part of the file name.

Cheers,

VP


Okay.  You *could* use the rename feature to rename the actual filename to include this 'incorrectly' just to get the bad/wrong info into the filename, then do as I suggested.

Or, if they are all named as you suggest 01 - Enter Sandman, you could fill properties from filename..., and just use [Track] - [Name] and it would either fill or overwrite those 2 fields with the data from the filename, which I think would solve the original issue also (renaming the Name field).

In other words, there's more than one way to skin a cat ;)  hopefully one of these methods gets you all fixed up :)
Logged
pretend this is something funny

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #30 on: August 22, 2011, 12:46:18 pm »

And another new way...

With the new regular expression support, this can also be done as:

   RegexSearch([name],/#^([^-]+) - #/)

This looks in [name] for the pattern:

  ^([^-]+) -

which says:

 - beginning of line...
 - start remembering...
 - all characters that are not a dash...
 - one or more of those...
 - stop remembering...
 - followed by a space and a dash

So, this matches names of the form:

   name - stuff

If you put it in an expression column, you can see what is matched.  This allows you to select the desired files.  And then you use the same expression to update the name tag (appending an = sign) :

   =RegexSearch([name],/#^([^-]+) - #/)
Logged
The opinions I express represent my own folly.

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #31 on: August 22, 2011, 01:11:10 pm »

And another new way...

With the new regular expression support, this can also be done as:

   RegexSearch([name],/#^([^-]+) - #/)

This looks in [name] for the pattern:

  ^([^-]+) -

which says:

 - beginning of line...
 - start remembering...
 - all characters that are not a dash...
 - one or more of those...
 - stop remembering...
 - followed by a space and a dash

So, this matches names of the form:

   name - stuff

If you put it in an expression column, you can see what is matched.  This allows you to select the desired files.  And then you use the same expression to update the name tag (appending an = sign) :

   =RegexSearch([name],/#^([^-]+) - #/)

Coolness - but it's making me feel like that guy in the movie Sneakers who is describing the mechanics of his algorithm to decode any encrypted system :) (Hey - I think some of the actual characters in this expression are in the movie!)

For me - as powerful as I know MC can be - if it takes me longer to write/test/debug an expression than it takes to just change the name field manually (or via light speed over many files with Tag N' Rename) then MC is not the tool for the job.

Plus - in many of it's fields and spots that this could be useful - MC has no ability to remember or save the expression text so it's a case of recreating it every time...too much of a time waster.

Cheers,

VP
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Re: How do I "trim" items from "Name" field using Rename, Move & Copy?
« Reply #32 on: August 22, 2011, 01:51:15 pm »

For me - as powerful as I know MC can be - if it takes me longer to write/test/debug an expression than it takes to just change the name field manually (or via light speed over many files with Tag N' Rename) then MC is not the tool for the job.

Plus - in many of it's fields and spots that this could be useful - MC has no ability to remember or save the expression text so it's a case of recreating it every time...too much of a time waster.

I would generally agree that for just a few files, manual can be faster.

however, the fill properties from filename is VERY fast, and once you "get it", you can use it for almost anything.

remember that MC won't change your tags, so even if your files are perfectly named right now, but the [Name] field is messed up; you can "Rename..." all those files to the 'wrong' name field as the full/only name, use that to fill properties from filename to 'fix' the [Name], then rename the files back to correct.

this all would take about 20 seconds for thousands of files, once you know how it works.

This only takes this long *because* it has the
Quote
ability to remember or save the expression text so it's a case of recreating it every time

You should see an arrow for Recent> when you r-click the name enter field for the rename.  I think it remembers about 10 or 12 recent variations.  it's all very fast.

as for using expressions for this kind of job; kind of like a sledge hammer for finish nails, but it'll work too, if you're careful :)
Logged
pretend this is something funny
Pages: [1]   Go Up