cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Any way to output to multiple txt files with unique filenames using ACL?

Level 3

Any way to output to multiple txt files with unique filenames using ACL?

Here's the line of code that creates a txt file on my C: drive. $var1 is just text.

eval $var1 output=C:\reports\report_1.txt;

 

I have multiple documents open and want to create a report of each document, but when I run the script, the output text file gets overwritten for every document I want a report of. I would like it so that each time I run the script on a different document, I get a new text file (i.e., report_1.txt, report_2.txt, report_3.txt).

 

I've tried using a variable in the output filename like below, but unless I source my acl file every time before running my script, it won't create multiple unique files. The eval command doesn't recognize the $n variable and just creates the filename without the variable.

eval $var1 output=C:\reports\report_$n.txt;

 

I've also tried putting the path of the filename into a variable, but that doesn't work either.

$path_var = C:\reports\report_$n.txt;

eval $var1 output=$path_var;

 

Anybody have an idea of how to solve this without hiring someone to manually rename each text file before running the report script?


Thank you in advance.