Renaming multiple files using rename [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

up vote
0
down vote

favorite

I’m looking to rename multiple files without perfectly uniform. I want to replace the differing parts to have uniform filenames. E.g. With the following files,

plrr=messi_equipe=barcalona_id=01_num=10.png
id=02_player=suarez_equipe=barcalona_num=09.png

to

player="messi"_equipe="barcalona"_num="10"_id="01".png  
player="suarez"_equipe="barcalona"_num="09"_id="02".png

and:

Rick and Morty - S01E01 - Pilot HDTV-720p
Its Always Sunny in Philadelphia Season 01 Episode 01 - The Gang Gets Racist

to

tvshow="Rick and Morty"_saison="01"_episode="01"_episodename="Pilot"
tvshow="Its Always Sunny in Philadephia_saison="01"_episode="01"_episodename="The Gang Gets Racist"

How would I go about doing this with command rename?

share|improve this question

closed as unclear what you’re asking by Jeff Schaller, G-Man, thrig, RalfFriedl, Thomas Nov 30 at 10:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it’s currently written, it’s hard to tell exactly what you’re asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • The simple answer (or non-answer, rather) is that you don’t. rename (even the more capable Perl version) is still meant to do relatively simple renames. To accomplish this, you’d really be best off writing a script to parse your file names and rename them as desired; if parsing them isn’t possible… then you’ll have to it by hand.
    – derobert
    Nov 29 at 21:26

  • Is player really misspelled as plrr in your files or is that just a typo in your question? In other words, can the word “player” be relied upon in your starting set of file names? If so, I think sed may be able to do this.
    – Jeff H.
    Nov 29 at 22:17

  • @JeffH. yes, it misspelled as plrr,I know I’m asking for a lot though, so like @derobert said I don’t do it with rename
    – zakariae oulqaid
    Nov 29 at 23:03

  • Is it misspelled in your Question, or is the file actually misspelled? How many variations and misspellings do you expect?
    – Jeff Schaller
    Nov 30 at 2:04

  • What’s the criteria for leaving off “HDTV-720p” in the Rick and Morty example but leaving “Gang…” in the 2nd example?
    – Jeff Schaller
    Nov 30 at 2:05

up vote
0
down vote

favorite

I’m looking to rename multiple files without perfectly uniform. I want to replace the differing parts to have uniform filenames. E.g. With the following files,

plrr=messi_equipe=barcalona_id=01_num=10.png
id=02_player=suarez_equipe=barcalona_num=09.png

to

player="messi"_equipe="barcalona"_num="10"_id="01".png  
player="suarez"_equipe="barcalona"_num="09"_id="02".png

and:

Rick and Morty - S01E01 - Pilot HDTV-720p
Its Always Sunny in Philadelphia Season 01 Episode 01 - The Gang Gets Racist

to

tvshow="Rick and Morty"_saison="01"_episode="01"_episodename="Pilot"
tvshow="Its Always Sunny in Philadephia_saison="01"_episode="01"_episodename="The Gang Gets Racist"

How would I go about doing this with command rename?

share|improve this question

closed as unclear what you’re asking by Jeff Schaller, G-Man, thrig, RalfFriedl, Thomas Nov 30 at 10:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it’s currently written, it’s hard to tell exactly what you’re asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • The simple answer (or non-answer, rather) is that you don’t. rename (even the more capable Perl version) is still meant to do relatively simple renames. To accomplish this, you’d really be best off writing a script to parse your file names and rename them as desired; if parsing them isn’t possible… then you’ll have to it by hand.
    – derobert
    Nov 29 at 21:26

  • Is player really misspelled as plrr in your files or is that just a typo in your question? In other words, can the word “player” be relied upon in your starting set of file names? If so, I think sed may be able to do this.
    – Jeff H.
    Nov 29 at 22:17

  • @JeffH. yes, it misspelled as plrr,I know I’m asking for a lot though, so like @derobert said I don’t do it with rename
    – zakariae oulqaid
    Nov 29 at 23:03

  • Is it misspelled in your Question, or is the file actually misspelled? How many variations and misspellings do you expect?
    – Jeff Schaller
    Nov 30 at 2:04

  • What’s the criteria for leaving off “HDTV-720p” in the Rick and Morty example but leaving “Gang…” in the 2nd example?
    – Jeff Schaller
    Nov 30 at 2:05

up vote
0
down vote

favorite

up vote
0
down vote

favorite

I’m looking to rename multiple files without perfectly uniform. I want to replace the differing parts to have uniform filenames. E.g. With the following files,

plrr=messi_equipe=barcalona_id=01_num=10.png
id=02_player=suarez_equipe=barcalona_num=09.png

to

player="messi"_equipe="barcalona"_num="10"_id="01".png  
player="suarez"_equipe="barcalona"_num="09"_id="02".png

and:

Rick and Morty - S01E01 - Pilot HDTV-720p
Its Always Sunny in Philadelphia Season 01 Episode 01 - The Gang Gets Racist

to

tvshow="Rick and Morty"_saison="01"_episode="01"_episodename="Pilot"
tvshow="Its Always Sunny in Philadephia_saison="01"_episode="01"_episodename="The Gang Gets Racist"

How would I go about doing this with command rename?

share|improve this question

I’m looking to rename multiple files without perfectly uniform. I want to replace the differing parts to have uniform filenames. E.g. With the following files,

plrr=messi_equipe=barcalona_id=01_num=10.png
id=02_player=suarez_equipe=barcalona_num=09.png

to

player="messi"_equipe="barcalona"_num="10"_id="01".png  
player="suarez"_equipe="barcalona"_num="09"_id="02".png

and:

Rick and Morty - S01E01 - Pilot HDTV-720p
Its Always Sunny in Philadelphia Season 01 Episode 01 - The Gang Gets Racist

to

tvshow="Rick and Morty"_saison="01"_episode="01"_episodename="Pilot"
tvshow="Its Always Sunny in Philadephia_saison="01"_episode="01"_episodename="The Gang Gets Racist"

How would I go about doing this with command rename?

linux command-line rename

share|improve this question

share|improve this question

share|improve this question

share|improve this question

edited Nov 29 at 21:57

roaima

42.3k550116

42.3k550116

asked Nov 29 at 21:16

zakariae oulqaid

32

32

closed as unclear what you’re asking by Jeff Schaller, G-Man, thrig, RalfFriedl, Thomas Nov 30 at 10:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it’s currently written, it’s hard to tell exactly what you’re asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

closed as unclear what you’re asking by Jeff Schaller, G-Man, thrig, RalfFriedl, Thomas Nov 30 at 10:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it’s currently written, it’s hard to tell exactly what you’re asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • The simple answer (or non-answer, rather) is that you don’t. rename (even the more capable Perl version) is still meant to do relatively simple renames. To accomplish this, you’d really be best off writing a script to parse your file names and rename them as desired; if parsing them isn’t possible… then you’ll have to it by hand.
    – derobert
    Nov 29 at 21:26

  • Is player really misspelled as plrr in your files or is that just a typo in your question? In other words, can the word “player” be relied upon in your starting set of file names? If so, I think sed may be able to do this.
    – Jeff H.
    Nov 29 at 22:17

  • @JeffH. yes, it misspelled as plrr,I know I’m asking for a lot though, so like @derobert said I don’t do it with rename
    – zakariae oulqaid
    Nov 29 at 23:03

  • Is it misspelled in your Question, or is the file actually misspelled? How many variations and misspellings do you expect?
    – Jeff Schaller
    Nov 30 at 2:04

  • What’s the criteria for leaving off “HDTV-720p” in the Rick and Morty example but leaving “Gang…” in the 2nd example?
    – Jeff Schaller
    Nov 30 at 2:05

  • The simple answer (or non-answer, rather) is that you don’t. rename (even the more capable Perl version) is still meant to do relatively simple renames. To accomplish this, you’d really be best off writing a script to parse your file names and rename them as desired; if parsing them isn’t possible… then you’ll have to it by hand.
    – derobert
    Nov 29 at 21:26

  • Is player really misspelled as plrr in your files or is that just a typo in your question? In other words, can the word “player” be relied upon in your starting set of file names? If so, I think sed may be able to do this.
    – Jeff H.
    Nov 29 at 22:17

  • @JeffH. yes, it misspelled as plrr,I know I’m asking for a lot though, so like @derobert said I don’t do it with rename
    – zakariae oulqaid
    Nov 29 at 23:03

  • Is it misspelled in your Question, or is the file actually misspelled? How many variations and misspellings do you expect?
    – Jeff Schaller
    Nov 30 at 2:04

  • What’s the criteria for leaving off “HDTV-720p” in the Rick and Morty example but leaving “Gang…” in the 2nd example?
    – Jeff Schaller
    Nov 30 at 2:05

The simple answer (or non-answer, rather) is that you don’t. rename (even the more capable Perl version) is still meant to do relatively simple renames. To accomplish this, you’d really be best off writing a script to parse your file names and rename them as desired; if parsing them isn’t possible… then you’ll have to it by hand.
– derobert
Nov 29 at 21:26

The simple answer (or non-answer, rather) is that you don’t. rename (even the more capable Perl version) is still meant to do relatively simple renames. To accomplish this, you’d really be best off writing a script to parse your file names and rename them as desired; if parsing them isn’t possible… then you’ll have to it by hand.
– derobert
Nov 29 at 21:26

Is player really misspelled as plrr in your files or is that just a typo in your question? In other words, can the word “player” be relied upon in your starting set of file names? If so, I think sed may be able to do this.
– Jeff H.
Nov 29 at 22:17

Is player really misspelled as plrr in your files or is that just a typo in your question? In other words, can the word “player” be relied upon in your starting set of file names? If so, I think sed may be able to do this.
– Jeff H.
Nov 29 at 22:17

@JeffH. yes, it misspelled as plrr,I know I’m asking for a lot though, so like @derobert said I don’t do it with rename
– zakariae oulqaid
Nov 29 at 23:03

@JeffH. yes, it misspelled as plrr,I know I’m asking for a lot though, so like @derobert said I don’t do it with rename
– zakariae oulqaid
Nov 29 at 23:03

Is it misspelled in your Question, or is the file actually misspelled? How many variations and misspellings do you expect?
– Jeff Schaller
Nov 30 at 2:04

Is it misspelled in your Question, or is the file actually misspelled? How many variations and misspellings do you expect?
– Jeff Schaller
Nov 30 at 2:04

What’s the criteria for leaving off “HDTV-720p” in the Rick and Morty example but leaving “Gang…” in the 2nd example?
– Jeff Schaller
Nov 30 at 2:05

What’s the criteria for leaving off “HDTV-720p” in the Rick and Morty example but leaving “Gang…” in the 2nd example?
– Jeff Schaller
Nov 30 at 2:05

active

oldest

votes

active

oldest

votes

active

oldest

votes

active

oldest

votes

active

oldest

votes

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *