Choose a short, stable task, such as organizing exported files by month. Note what needs to be read, modified, and produced. Provide exceptions, such as a name already present or a missing date.
Prepare a Verifiable Script
- Request a simulation mode that displays each action and an explicit write mode.
- Add a test with two valid files, a duplicate, and a malformed entry.
- Run the example on a copy. Compare the list of actions to the files actually obtained.
Write a script that sorts a copy of these files by date. Show the simulated movements. In case of a duplicate, keep both files and report the discrepancy.
Provide a Rerun
Run the script on the result to verify that it does not repeat the same movements. Keep a short log and the appropriate restore command. Switch to your usual data after checking a representative batch.
Prepare a sorting script on copies
You want to sort invoices by month. Describe how to find the date, for example, in the file name, and where to place an entry whose name does not match the pattern. Give NEO four mock examples, including two files that produce the same destination name. Request a simulation that displays the source, destination, and reason for any rejection.
Run the simulation on a copy and reread each line. If two documents have the same destination, keep both names or flag the difference according to your rule. Request a minimal log of actions performed. Keep the original copy during the initial tests.
Test the recovery after a problem
- Split the test into two small batches and run the command again on the result.
- Verify that the files already sorted remain in their place and that the others are processed.
- Compare the number of files and open two documents after the recovery.
If a write error occurs, log the affected file and correct the cause before running the test again. Keep the test command and the save rule in the folder. You can have someone else review the behavior without giving them access to the actual documents.
See also
Planning for the stopping and resuming of a processing script
Start by copying a few files and listing the expected changes. For a sorting script, specify the input folder, the naming convention, and the output folder. Add two files that would have the same output name. The script should detect this situation and follow an explicit rule, such as reporting the conflict and leaving the affected files pending.
Request a simulation mode that displays the planned operations. Compare this list to the test folder, then perform the processing in a separate location. If the process stops mid-batch, the report should indicate which files were processed. A new execution must recognize the results already produced or regenerate them according to a known rule.
Prepare a script with an input folder, an output folder, and a simulation. For each file, specify the intended action. Describe the expected result in case of a duplicate name, an unreadable file, or resumption after an interruption.
Before running a real batch, replay the same test on the same copy. Compare the number of results, the names, and representative content. Also, cause an interruption in the test folder and verify the resumption. Keep the command used and the report with the generated files. You can add a new batch by verifying the scope of the operation before modifying the data you use daily.