D
D
DK2011-09-07 19:42:20
JPEG
DK, 2011-09-07 19:42:20

Is it possible to replace the filenames with the numbers assigned to them in the .txt file?

51206ba6.png
You need to replace the text names with the specified numbers.
Each file is defined by code, for example:

[card]<br/>
primitive=Accorder Paladin<br/>
id=213818<br/>
rarity=U<br/>
[/card]

Can this be done automatically, otherwise you don’t want to manually sort through several thousand files?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
T
tick, 2011-09-07
@tick

Forest (1).jpg
Forest (2).jpg
I foresee problems…

P
powder96, 2011-09-07
@powder96

You can, here, for example, in PHP it is very easy to implement.

K
kostik450, 2011-09-07
@kostik450

Similar and even more fancy things can be done in FAR 2.0 using macros. FAR can remember keystrokes and assign them to one key (Ctrl-5, for example). And since there are similar actions here (select a line in TXT, then copy it to the clipboard, etc.),
then these presses can be assigned to one keystroke. And then it “magically” repeats itself if you hold the Ctrl-5 key “in auto-repeat”. And on the screen at this time, the computer does all the dirty work for you. And you don't need to write scripts! Writing a script is not a problem, but debugging it so that it works without errors is a long time.
Although, when they ask me how I did everything so quickly, I answer - “I wrote the script”, like I’m a cool programmer, I’ve never been a lamer. And I myself am still programming on FAR-e)))
In short, from this cacophony of lines from [card] to [/card], make one line directly in a text file: ren “Acorder Planer.jpg” 213818.jpg delete the rest, then remember this in macros and repeat for each block of lines from [card] to [/card]. Use more search by the keywords primitive, id - so as not to be tied to extra line breaks or a possible violation of the structure of records, etc.
The result is a set of strings
ren "Acorder Planer.jpg" 213818.jpg
ren "Ardent Recruit.jpg" 213794.jpg
...
and so on.
You write the resulting file to the batch file runme.cmd and run it for execution. And for control, I would also make a batch file with reverse renaming, but this is already superfluous.

L
Laplace, 2011-09-07
@Laplace

In general, Total Commander has a powerful Multi-Rename Tool, which, among other things, has "Load names from file ..." and "Edit names ...", only you have a list of new names in a slightly wrong format, theoretically . If you are sure that the order of the codes matches the order of the files, then you can simply cut off the codes themselves with a grep-sed and feed them to the total commander. But it's better to sketch a script, I think.

I
int03e, 2011-09-07
@int03e

It is implemented on any scripts (bash/perl/php/python/ruby/etc). What is the question, do you need a ready-made script? Unsubscribe in a personal, there is nothing to do :-)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question