Hey everyone, newbie at the site.
Been using Ubuntu on and off for a year now. While I usually take a hands on approach to learning this stuff, my new external HD has just arrived and I want to back everything up in a semi organised fashion asap.
I want to create a script to read the contents of a directory and create folders in that directory from the named files within and then move the corresponding files to their new folder.
i.e.
Desktop/Folder 1
file 1.doc
file 2.xls
would become
Desktop/Folder 1/file 1/
file 1.doc
Desktop/Folder 1/file 2/
file 2.xls
I tried this in Windows and the script collapsed when it ran into files named with spaces i.e "file 1.doc" creating a folder "file" and obviously not moving the corresponding file.
I tried the search function in the forums and of course google, but surprisingly for such a trivial (or so I thought) task I found very little.
Can anyone help me?
Cheers,
r34ch
Bookmarks