Surf offers various ways for you to write extraction results to a file (or files) so you can process the results in other commands and tools.
-o) parameter writes all results to a single file, in whatever output format is selected (usually
For example, the following command writes the results in
csv format to
surf extract myextractor *.pdf -f csv -o results.csv
Note that any existing file with the same name will be overwritten.
An alternative way of achieving the same thing is to redirect stdout, like this (on Windows):
surf extract myextractor *.pdf -f csv > results.csv
-m) parameter writes results for each input file into a separate results file in the same directory, with the same name but different file extension. The extension is determined from the output format being used.
For example, let's say we have these two files in a directory:
-m option with the
csv output format will create the following results files in the same directory:
0001.csv will contain only the results for 0001.tif and so on.
To create individual results files, simply add the
-m parameter. Normally you'll also want to specify
json format when using this parameter, like this:
surf extract myextractor *.pdf -f csv -m
Note that any existing files with the same names as the results files will be overwritten.
Displaying progress information
If you are processing multiple files and writing results to a file (or files) using the
-oparameters, you can display a progress bar using the
-pparameter. This will show you how many files have been processed and how many are still pending.
Updated over 4 years ago