File Mover Blog

November 19, 2023

How to move files based on data from a csv file

How to move files based on data from a csv file

Q: I have the Limagoto X software installed, and I would like to know if it’s possible to move files, based on some information from a csv file? I have an csv file with some order numbers, and the folders I want to move, are label with these order numbers.

A line in the csv file would look like this:

The file structure looks like this:

limagito file mover folder structure example

So I would have to extract “D” first letter of “Donald Duck” -> then look in folder “Donald Duck”\ordre and search for 9999999 and move that folder to a new location with the same folder structure.

A: We asked and received a dummy csv file, data content lookes like:

Ordre;9876543;SAND;17-11-2023;Arkiveringstest;Limagito Complete;AABEN_ARKIV;ARK;TEAM-E;MHOE

So in this example:

  • We would strip the first char of the ‘Kundenavn’ field:  L
  • Next it would be the full name of the same ‘Kundenavn’ field:  Limagito Complete
  • Add fixed text:  Ordre
  • And finally the value of data field ‘Ordre’:  9876543

Result as Directory filter: *\L\Limagito Complete\Ordre\9876543\*

  • As source we used a Windows folder, root folder to start from is ‘Jobs’ :

limagito file mover windows folder as source

  • Next we’ll need to add a ‘Pascal Script’ to strip data from the csv file and use it as directory filter:

limagito file mover pascal script option

  • Enable and add the following ‘On Rule Begin’ Pascal Script:

You can download the script: here

Do not forget to adjust the ctDataPath const (must end with a \ ). In this path we’ll search for .csv data file(s) with a date structure in its filename like ‘YYYY-MM-DD’. This can, of course, be adjusted.

limagito fil emover move files based on data from a csv file

  • Directory filter setup:

limagito file mover directory filter setup

The %VSA (= Var String A) configured by the previous script will be used as ‘Directory Name Include Filter’:

limagito file mover directory filter

This ‘Allow parameters in Directory Name Filter’ option should be enabled by default:

limagito file mover directory filter

  • As Destination we used a Windows folder:

limagito file mover windows folder as destination

  • RunTime log result:

limagito file mover runtime log result

#csv #managedfiletransfer #filetransfer #filemanagement

If you need any help with this ‘move files based on data from a csv file’ request, please let us know.

Best Regards,

Limagito Team

By Limagito-Team CSV Filters Pascal Script , Share: