Collection

Copy Files

Copies every file, or only the files named in a list of document names or hashes, into a new folder, proving each copy is exact and reporting any list entries that matched nothing.

Free Command line: copy-files Version 1.0

Copy Files pulls documents out of a collection or production without touching the source. Every copy is written to the run's files folder, re-read and hash-checked against the original, and keeps the original created, modified and accessed times.

You can copy everything (narrowed by extension if you like), or paste a list of names or hashes, for example a list of document IDs from a review platform or a hash list from the other side. Entries that matched no file are listed in not-found.csv, so a short list is never silently treated as complete.

Use it when

How to run it

  1. Choose the folder to copy from as Input, and a folder outside it as Output.
  2. Set Select: All to copy everything, Names to copy files whose names are in a list, or Hashes to copy files whose hash is in a list.
  3. For Names or Hashes, paste the entries into List (one per line), choose a List file, or both.
  4. For Names, choose how names are matched with Match (Stem is the default).
  5. Choose Layout (Keep the folder structure, or Flatten into one folder) and the Hashes to record.
  6. Optionally turn on dry-run first to see what would be copied and where.
  7. Click Run, then use Open report to review the results and not-found.csv.

Settings

Every setting has the same help beside it in the app. On the command line, pass each as --name value; ltk help copy-files lists them.

Settings

SettingWhat it doesType and default
Select
--select
Which files to copy: All, Names (from the list) or Hashes (MD5/SHA-1/SHA-256 from the list).
If you give a list but leave Select on All, the run stops rather than ignoring the list and copying everything. Set it to Names or Hashes, or clear the list.
choice: All, Names, Hashes
All
List
--list
Names or hashes to copy, one per line (paste from Excel is fine). Lines starting with # are ignored.
Blank lines and lines starting with # are ignored, surrounding quotes and spaces are removed, and repeated entries are dropped (ignoring case). A name entry must be a file name, not a path: lines with characters that cannot appear in a file name are skipped and logged in errors.csv. A hash list can mix MD5, SHA-1 and SHA-256; the type is worked out from the length, and anything that is not 32, 40 or 64 hex characters is logged as an error.
Shown when select = Names or Hashes
text (lines)
empty
List file
--list-file
Optional text file with names or hashes, one per line. Combined with the list above.
Shown when select = Names or Hashes
file
empty
Match
--match
How names are matched: Stem (name without extension — catches every format of a document), Exact (full name), or Prefix (name starts with the entry; broadest, check the report).
Stem compares the name without its extension (or the full name), so ABC0001 picks up ABC0001.pdf and ABC0001.docx. Exact needs the full name with extension. Prefix matches any file whose name starts with the entry, so ABC0001 also picks up ABC0001_attachment.pdf and ABC00012.pdf; where several entries fit, the longest is used. Check the MatchedItem column after a Prefix run.
Shown when select = Names
choice: Stem, Exact, Prefix
Stem
Layout
--layout
Keep the source folder structure, or Flatten everything into one folder (clashing names are numbered, never overwritten).
Keep recreates the source folders under files. Flatten puts everything in one folder; clashing names become name_(1).ext, name_(2).ext and so on, numbered in folder order so a repeat run gives the same names. Renamed copies are flagged in the Renamed column.
choice: Keep, Flatten
Keep
Hashes
--hashes
Hashes to record. Every copy is verified by re-reading it and comparing hashes (SHA-256 is used if none are chosen).
These are the hashes recorded in the report. Every copy is verified whatever you choose; if you choose none, SHA-256 is used for the check. When selecting by hash, the hash used to match does not appear in the report unless you also tick it here.
choices: MD5, SHA1, SHA256
MD5,SHA1
Dry run
--dry-run
Only report what would be copied and where; nothing is written except the reports.
Writes only the reports. Each row shows Would copy (dry run) and the planned destination, and not-found.csv is still produced, so this is a quick way to test a list.
yes/no
false

Common settings

SettingWhat it doesType and default
Input required
--input
Folder (or single file) to read. It is opened read-only and never modified. folder
empty
Output required
--output
Folder for reports. Must not be inside the input folder. Each run gets its own sub-folder. folder
empty
Recurse
--recurse
Include sub-folders. yes/no
true
Extensions
--extensions
Only process these extensions (e.g. .pdf, .docx). Empty means the tool's default set. list
empty
Parallelism
--parallelism
Files processed at once. Use 1-2 for spinning disks or network shares. number
4

What you get

Each run creates its own folder inside the output folder, with the report copy-files.csv, errors.csv and manifest.json (see Run folders and manifests).

Report columns

Check the result

Tips
  • Paste a column straight from Excel into List; quotes and stray spaces are cleaned off.
  • Use Extensions with Select All to copy only certain file types.
  • An entry counts as found if it matches any file, so one entry can bring back several formats of the same document under Stem matching.
Watch out for
  • A copy whose hash does not match the original is treated as an error and the bad copy is removed; check errors.csv and re-run for those files.
  • If the output drive runs out of space the run stops rather than failing every remaining file. Free space and run again.

From the command line

The command line is part of LitTechKit Pro. See Command line.

ltk run copy-files --input "D:\Matter\Collection" --output "D:\Matter\Out" --select Names --list-file "D:\Matter\requested-ids.txt" --match Stem --layout Flatten

Related tools