Topic "Create folder from file name"

Author Message
nickodemos
[View user's profile]

Joined: 2017-01-27
Posts: 2
Was wondering if it would be possible to have a script that would create folder based on the file name.

EG I would click on BSD.iso and choose the script to create a folder in current folder with the name BSD and move the BSD.iso into the newly created BSD folder.

I did a quick search and found nothing asking this.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25946
Location: Prague, Czechia
"click" in WinSCP GUI? In panel with a remote folder?
nickodemos
[View user's profile]

Joined: 2017-01-27
Posts: 2
Sorry I should have thought to put that in.

Yes. On the remote folder I would right click on a file to bring up the context menu and have an option under 'Custom File Commands' that would create a folder and move the file I clicked on into the newly created folder: root/BSD.iso >> root/BSD.iso/BSD.iso.

Only thing better would being able to remove the extension in the folder.

root/BSD.iso >> root/BSD/BSD.iso.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25946
Location: Prague, Czechia
I'm no *nix expert, so there can be a better solution, but should should do:

filename="!" && mkdir "${filename%.*}" && mv "!" "${filename%.*}"
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License