| Author |
Message |
   
rcole@emagsolutions.co.uk
Username: roncole
Registered: N/A
| | Posted on Monday, Mar 10, 2008 - 14:21: | |
I need to run a script that opens each file in a directory and removes the first 41 bytes from that file, saves the file, then it loops and opens the next file. Can this be done with the scripts. The removing of the 41 bytes is fine, but its the opening of the files I am struggling with. I am assuming that I use the Open command as in Open c:\folder\*.* but how do I get it to move to the next file as this will only open the first file. |
   
Stefan Fleischmann
Username: admin
Registered: 1-2001
| | Posted on Monday, Mar 10, 2008 - 14:37: | |
> as this will only open the first file No, "Open" with a wildcard file mask will open every file that matches, not just the first file. When done with one such file (the one in the active data window), close that file (Close) and repeat the removal with the next file. Repeatedly call ExitIfNoFilesOpen to stop processing when all files have been processed and all windows closed. |
   
rcole@emagsolutions.co.uk
Username: roncole
Registered: N/A
| | Posted on Monday, Mar 10, 2008 - 15:30: | |
Thanks Stefan I now see how the open works. It opens all the files first, is there a limit to this. I would like to open a file at a time as there are likely to be 1000+ files in a folder. My script is open c:\sn3584\1\Save0000\*.* { block 0 41 remove save close ExitIfNoFilesOpen }[unlimited] How can I make it open just one file at a time to process |
   
Stefan Fleischmann
Username: admin
Registered: 1-2001
| | Posted on Monday, Mar 10, 2008 - 15:58: | |
> How can I make it open just one file at a time to process For that you would need to know and specify the exact filename. Or maybe it's possible to use a batch file that does the outer logic and executes WinHex with the script for each file separately. |
   
rcole@emagsolutions.co.uk
Username: roncole
Registered: N/A
| | Posted on Tuesday, Mar 11, 2008 - 12:30: | |
Great Thought that might be the case, I will try to get it to work off a dos DIR list batch file. |