I was curious if anyone had an example or an idea of how to use a directory name as a variable. Basically, I’m looking to have Cloverleaf monitor a directory that has a bunch of sub folders in it and when a file shows up in any of those sub folders to do something to that file, and output it to the same folder, but in another OUT directory.
So essentially there is an In folder with sub directories and an Out folder with sub directories.
If the directory that’s in the In folder is labeled 1234, I want to append 1234 to ISA 8 in any file in that directory (working with X12 envelope), and put it in the out directory labeled out/1234.
I have a script I wrote to do the editing of the ISA, I’m essentially looking for a way to monitor MANY sub directories at the same time, take the sub directory name in as a variable, do something based on that name (via if/for or switch or something), and output it to the matching OUT sub directory. Example:
Input In1234 –> Append ISA8 with 1234 –> Output folder Out1234
Input Inabc1 –> Append ISA8 with abc1 –> Output folder Outabc1
Input Inblah –> Append ISA8 with blah –> Output folder Outblah
Any thoughts?