Create Symlinks from file list - PART 2
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

DISCLAIMER: I had a similar question and was thankfully answered here ( solution.

I have a list of multiple files where they are located.
Each file has a different uuid_1 and uuid_2 number.

The list with the original file location structure is: /UUID_NUMBER1/UUID_NUMBER2/NAME_OF_THE_FILE

The list with the original files looks like this:


The symlink needs to be created (after deleting the broken symbolic link) in the structure /YEAR/MONTH/DATE/NAME_OF_THE_FILE order that can be seen forming part of the filename: ABC_DE__FGGHJ20020526_152812_000050022006_00183_01239_0001.N1

portion with the date: FGGHJ20020526

date as in folder structure: /2002/05/26/



A way to extract the structure was explained here: using sed (can also be done with awk)

Ideally, I need to read from the list of files, extract the folder structure where the link needs to be created, delete the broken link and create the link in that folder.

awarded to Dudu

Crowdsource coding tasks.

1 Solution

Winning solution

I manage to solve it by finding all the files in each uuid folder and copy them to 1 specific folder in which each can be linked separately. So not the direct link to the original location I was looking for but it works