topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 2:14 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Drop file to rename it according to list of names  (Read 17745 times)

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Drop file to rename it according to list of names
« on: December 22, 2016, 01:17 AM »
Hi all,
How could I do the following?
I have a folder with files and a text file with a list of names (actually it's a spreadsheet with two columns)
What I'd want to do is to drag and drop each file to a listbox so it gets renamed

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #1 on: December 22, 2016, 01:53 AM »
Hi all,
How could I do the following?
I have a folder with files and a text file with a list of names (actually it's a spreadsheet with two columns)
What I'd want to do is to drag and drop each file to a listbox so it gets renamed

I had to rename a bunch of files using a text list just this week.
Used Oscar's Renamer after a 2006 (!) recommendation here on dc.
it isnt in development, but is still being sold :down:
I used the trial -- it worked on Windows 7 x64
it was very fussy: wouldn't work for a while, I think possibly because of an extra carriage return at the bottom of the list of new names. But it did work in the end.

Also found a couple of sites showing how to do it using spreadsheet (and?). Can check my desktop history later and post link/s.
Tom

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #2 on: December 22, 2016, 04:26 AM »
Thanks, I'll see if Oscar's Renamer works for me.
The problem is that new names and current ones are quite different and unrelated that's why I asked for a way to drag the file onto the list, since there is a column with descriptions so I can visually tell which file corresponds to the new name

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #3 on: December 22, 2016, 05:26 AM »
Thanks, I'll see if Oscar's Renamer works for me.
The problem is that new names and current ones are quite different and unrelated that's why I asked for a way to drag the file onto the list, since there is a column with descriptions so I can visually tell which file corresponds to the new name

I'll add a +1 to your request, would be very helpful to be able to do something like that
Tom

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #4 on: December 22, 2016, 06:35 AM »
Hi tomos. I can't see in Oscar´s Renamer how to rearrange files on the left panel to match the text lines from the right panel.
What I had in mind is something like one of those worksheets for children where they have to match figures on the left column to the related ones on the right by drawing a line :)

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #5 on: December 22, 2016, 07:03 AM »
I can't see in Oscar´s Renamer how to rearrange files on the left panel to match the text lines from the right panel.

I did it in a spreadsheet first...
Tom

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #6 on: December 22, 2016, 08:03 AM »
I can't see in Oscar´s Renamer how to rearrange files on the left panel to match the text lines from the right panel.

I did it in a spreadsheet first...
How did you did it?
I can make a csv out of the files folder to get all current names. Then I paste the csv column next to the column with new names. How can I match them correctly? Can you share some good tip?

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #7 on: December 22, 2016, 08:45 AM »
^ okay,
let me see:
first I need the filenames, old and new correctly synced in spreadsheet

Screenshot - 2016-12-22 , 15_37_35.jpgDrop file to rename it according to list of names

the second column are the current names,
I'm going to revert back to the previous naming system here.
Following does require having just the relevant files in a folder.

open Renamer,
select relevant folder - a doubled list shows in the main pane:
renaming is in the right column, so select that list

Screenshot - 2016-12-22 , 15_26_49.jpgDrop file to rename it according to list of names

(I've reduced the tree pane on the left for the screenshot)

Copy relevant cells from your spreadsheet, and paste in Renamer (might be best to paste in text editor first and then copy again ensuring you have exactly the correct number of lines):

Screenshot - 2016-12-22 , 15_28_02.jpgDrop file to rename it according to list of names

I think it was then:
menu: File > Apply changes to folder

Hope that works for you -- I did have to mess around a bit, but was doing it 'cold' :D
Tom

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #8 on: December 22, 2016, 06:10 PM »
@tomos fine what you explain, i can paste the new names on the right column but how to sort them to match the left column, by hand doing ctrl+x ctrl+v inside the textbox ? I'd rather a way to avoid this kind of manual process.. afaik there's no way to sort files of the left panel of Oscar's Renamer nor a way to rearrange its listbox elements to match the lines of text
« Last Edit: December 22, 2016, 06:16 PM by kilele »

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #9 on: December 22, 2016, 06:24 PM »
Yeah, things do need to be sorted in spreadsheet first: you need to have the correct names in the correct columns -
i.e.
A | B
C | D
where B & D are new names for A & C.
I sorted then by actual names in spreadsheet, then copied the new names (G00, etc. in example above) for pasting into renamer. I did not have to do any messing around in Renamer then. Might not be suitable for your needs, but was worth it for me.

So yeah, you need to do that work in advance.
Otherwise in Renamer, you can paste into or edit individual lines -- but I didnt use that capability myself.
Tom

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #10 on: December 22, 2016, 08:16 PM »
Thanks tomos for let me know about Oscar's Renamer.
Yes, definitively you have to rearrange cells on the spreadsheet before pasting into the renamer's text editor.
Do you know some way to drag a file from winexplorer and drop it to some spreadsheet program or text editor so the file name be pasted? msexcel does not allow to do such drag&drop

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #11 on: December 23, 2016, 04:21 AM »
Hi Tomos. How about using Skwire's "Text 2 Folders" ? this app will make folders out of the column with new names, then I will drop one by one the files on each folder, finally I need some script to rename files with their folder name. I think this will soothe somewhat my pains  ;D

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #12 on: December 23, 2016, 06:41 AM »
Do you know some way to drag a file from winexplorer and drop it to some spreadsheet program or text editor so the file name be pasted? msexcel does not allow to do such drag&drop

I used my file manager (Dopus) to copy the filenames. Other file-managers can do this too, e.g. XYplorer.

Note: for me it was also worth my time doing it in spreadsheet, because I needed to keep a record of old vs. new names.
Tom

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #13 on: December 26, 2016, 03:18 PM »
Does it have to be drag and drop?  Wouldn't a batch file be better from the point of view of automation?  At its simplest, you'd just have a series of lines like

if exist abc123.xyz ren abc123.xyz widgets_report.txt

and you could add in refinements like moving the file to a different location, making a backup and renaming it using something like BRC (the command-line version of BRU (Bulk Rename Utility), and triggering the whole thing automatically using one of the various folder-watching utilities, e.g. perhaps NewFileGo to name a recent free one (that admittedly I haven't tried).

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #14 on: December 28, 2016, 02:31 PM »
@rjbull
I wanted to avoid typing by hand hence the drag&drop approach
Folders' names may be formed with delimiters to keep old information. These separators can be used later by any renamer to remove unwanted info
« Last Edit: December 28, 2016, 02:42 PM by kilele »

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,832
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #15 on: January 05, 2017, 06:57 PM »

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #16 on: January 05, 2017, 08:30 PM »
@Target thanks for the tip on how to rename files using Excel and Advancedrenamer.
I had new names on a column and descriptions on the other one (not the current files names).
In the end I used "Text 2 Folders" and den4b renamer

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #17 on: January 19, 2017, 05:34 AM »
Maybe this helps:


I have a folder with files and a spreadsheet with two columns with a list of names.
Current names on the left column (A), the new names on the right column (B).
Old name.txt   |   New wanted.txt
Alter Name.TXT   |   Neuer Name.TXT
Current name.txt   |   Target Name.txt



Use third column (C) and enter a formula in C1:

=" Ren " & """" & A1 & """  " & """" & B1 &""""

After pressing ENTER key you will get:

Old name.txt   |   New wanted.txt    |   Ren "Old name.txt"  "New wanted.txt"
Alter Name.TXT   |   Neuer Name.TXT   
Current name.txt   |   Target Name.txt   




Now select C1 and double click at the black square at the bottom right of that cell.
The formula is copied down.

Awaited Result:

Old name.txt   |   New wanted.txt    |   Ren "Old name.txt"  "New wanted.txt"
Alter Name.TXT   |   Neuer Name.TXT    |   Ren "Alter Name.TXT"  "Neuer Name.TXT"
Current name.txt   |   Target Name.txt    |   Ren "Current name.txt"  "Target Name.txt"




At last, select whole C-column, paste to a New Textfile.txt.
Open that file (add '@ECHO OFF' as new first line) and see if all went fine.
Change extension to .CMD and run on a copy of your real files (or have a backup).

DOS command REN will try to find file with name on the left, and if found, rename with name on the right.



---------------------------------------RenameBatch.CMD
@ECHO OFF

Ren "Old name.txt"  "New wanted.txt"
Ren "Alter Name.TXT"  "Neuer Name.TXT"
Ren "Current name.txt"  "Target Name.txt"

PAUSE
---------------------------------------



 

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
Re: Drop file to rename it according to list of names
« Reply #18 on: February 01, 2017, 03:36 PM »
@AbteriX
Very useful! though, as I said above, I was not given two columns with old names sided with new names, just new names with a brief description.
I solved the task as explained above with manual drag&drop :D