20 December 2021, 14:50 | #1 |
Registered User
Join Date: Jun 2020
Location: Germany
Posts: 373
|
Rename file, get new name from file?
Hi,
not sure if this is the correct section or it would be better in Apps. I'm looking for a way to read the new name for a file from a file/variable. Something like this: http://aminet.net/package/util/cli/FileComment But for renaming files. I've tried stuff like: Code:
Rename "OldName" <RAM:FileWithNewNameInIt I probably could write some scripts which uses http://aminet.net/package/util/cli/SRename(which can copy the file name to the comment and vice versa) and http://aminet.net/package/util/cli/readcomment (to export the comment), but I wouldn't mind a simpler way. Now, that I think of it. Is there an easier way to copy a file name into a file/variable? I'm using all the tools from above to copy the file name to the comment and then export the comment into a variable. Which I then import as comment in other files. I'm doing this for archives, so that I can trace from which archive the files came. If I could skip the step copying the name to the comment, that would be great too. |
20 December 2021, 14:56 | #2 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,317
|
Quote:
Code:
rename original $foo To take a new name from a file, learn about the backticks. They take the output of a file, and place it as argument on the line: Code:
rename original "`type file_containing_new_name`" |
|
20 December 2021, 15:20 | #3 |
Registered User
Join Date: Jun 2020
Location: Germany
Posts: 373
|
Wow, thanks for the quick help. It works great.
I have used backticks before, but not that much that I thought it would help here. Also for my question about copying a file name to a file/variable, im using FilePart from the 0Utils package now. Off to make some custom entries for DirOpus. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trying to archive an lha file inside a new lha file | Foebane | support.Apps | 6 | 11 December 2019 21:08 |
asm code file errors and external file locations | Brick Nash | support.WinUAE | 0 | 06 April 2015 17:14 |
File .NFO & file ID.diz stuff.... How To..!! | DC33 | support.Other | 4 | 11 March 2009 10:21 |
Running non .adf file, .info file?? | ypestis | New to Emulation or Amiga scene | 5 | 29 March 2006 18:53 |
1 GB Harddisk file | Anubis | support.WinUAE | 5 | 27 March 2006 14:39 |
|
|