Naming

Specify the convention for naming documents.


Selection of the filename

Renaming optionsDescriptionTypical example

Use original file name

  • The document is only divided up and not renamed on the basis of the barcode
  • Output files use the source document name
A preprocess already renames the files. The original filename is kept.

Use recognized barcode as the file name

  • The document is renamed based on the recognized barcode
The processed documents should be searchable by barcode value

Additional renaming options

Renaming optionsDescriptionTypical example

Add to the file name as a prefix

  • Puts the characters entered at the beginning of the file name
  • The placeholders specified on the right can be used

Every file should have a text or timestamp prepended, to enable chronologically sorted files by name inside of a file browser

Add to the file name as a suffix

  • Puts the characters entered at the end of the file name
  • The placeholders specified on the right can be used
To relate the processed file to the original document, the original filename should be attached

Replace characters in the file name that are invalid in NTFS with

  • The following characters are invalid in the file name in the NTFS file system: / ? < > \ : * | ”
  • If the barcodes contain characters such as this you can specify a replacement character that appears in place of the invalid character when the file is saved
  • If no replacement character is specified, the invalid characters are removed
The barcode value contains invalid characters, that are later used as a filename. Since a file with invalid characters can't be created on an NTFS file system, the file will be moved inside the error folder and named "Naming Error"

Replace text in the output filename

Additionally, you can replace specific characters or strings in your barcode. Just enter the text that BarcodeOCR should file (i.e. INV-) and define, which text should be replaced. (i.e. INVOICE-).

You can choose placeholder or variables listed below if you need further customization. After entering the text to find and the text that should be replaced, choose "Add to list" to add the replacement to the list.

You can save different replacements to the list. They will be processed in the order of display. If you like to delete a replacement, click the entry and choose "Remove from list".

Samples:

FindReplace withBarcode textAfter replacement
INV-

INVOUCE-

INV-12345INVOICE-12345
DATE%TODAY%SCAN-DATESCAN-01.01.16
Invoice(leer)Invoice56785678

Placeholder

PlaceholderSample valueDescription
%YEAR%2016The current year
%MONTH%01The current month
%DAY%01The current day
%TODAY%01.01.16The current date
%TIMESTAMP%09-12-06-032The current timestamp with milliseconds (hh-mm-ss-fff) (recommended for sorting within the filesystem)
%OLDFILENAME%Scanner-01929284Filename of the input file
%MD5%3c4cbcc7b0b7422b2c0e99ecfebdab14MD5-Hash of the output file
%PGCNT%2A number of pages within the saved document
%LOCALCOUNTER%15consecutive number for per configuration which will be increased for each saved document by 1
%GLOBALCOUNTER%628consecutive number for per BarcodeOCR installation which will be increased for each saved document by 1



Create Subfolders and sort the result files into the folders

BarcodeOCR can create a defined subfolder structure in the selected output folder, where the output documents can automatically be sorted in. Nonexisting subfolders will be created while processing the documents and before saving the result file with the desired file name into the folder.

Use a template for the sort

Most requirements can already be accomplished using a preconfigured template for creating a subfolder structure. Some of the templates can be used using a parameter to adjust the template to your needs:

Name of templateParameter is used forSample (bold = subfolder structure)

Date (Format: yy-MM-dd)

no parameter needed

Sample Barcode: INVOICE-1234
Path: Outputfolder\2017-07-12\INVOICE-1234.pdf

Date (Format: MM-dd)

no parameter needed

Sample Barcode: INVOICE-1234
Path: Outputfolder\07-12\INVOICE-1234.pdf

Date (Format: MM-dd-HH)

no parameter needed

Sample Barcode: INVOICE-1234
Path: Outputfolder\07\INVOICE-1234.pdf

Day (dd)

no parameter needed

Sample Barcode: INVOICE-1234
Path: Outputfolder\2017-07-12\INVOICE-1234.pdf

Hour (HH)

no parameter needed

Sample Barcode: INVOICE-1234
Path: Outputfolder\2017-07-12\INVOICE-1234.pdf

Subfolder based on delimiter

delimiter

Sample Barcode: INVOICES@2017@004
Parameter: @
Path: Outputfolder\INVOICES\2017\004\INVOICES@2017@004.pdf

Custom Date Format

date format)

Sample Barcode: INVOICE-1234
Parameter: yyyyMMddHHmmss
Path: Outputfolder\20170712191045\INVOICE-1234.pdf

Use the first X characters from barcode as subfolder

count of charactersSample Barcode: INVOICE-1234
Parameter: 7
Path: Outputfolder\INVOICE\INVOICE-1234.pdf
Use the last X characters from barcode as subfoldercount of characters

Sample Barcode: INVOICE-1234
Parameter: 4
Path: Outputfolder\1234\INVOICE-1234.pdf


Use an external script to define the name of the subfolder


There are sample files in the folder "Script Samples" in the BarcodeOCR installation folder showing how to customize BarcodeOCR to your needs


If you need to create complex folder structures, the template might not provide all flexibility. In these cases, you can use a PowerShell script to determine the subfolder (or nested subfolders) as well as set the output filename. This script will be launched while processing the file before saving the document into the output folder. All information regarding the document and the source stack will be passed as a parameter to the script to ensure that you have all information in order to create your folder structure.

You can access all collected information regarding the recognized text (if the document was OCRed) as well as all information regarding barcodes and use the information without restricted to determine the filename and the folder structure. 

Using this option you can achieve:

  • Sort the documents into subfolders - based on keywords within the recognized text (A sample is included as script in the folder "Script Samples" in the Installation directory)
  • Sort Invoices into an "Invoice folder", Offers into a separate "Offers folder" as well as all other documents into another folder - based on keywords within the barcode
  • Determine the subfolder path using your own algorithm (you can use all script options from PowerShell to do so)
  • Set a completely new file name that is not associated with the recognized barcode
  • Create a nested folder structure
  • Use recognized but ignored barcodes (using filters) as subfolder name
  • All kind of other scriptable options

Please note, that PowerShell-Scripts needs to be signed before using them, or the ExecutionPolicy needs to be adjusted to your needs. If the PowerShell script can't be executed, BarcodeOCR won't be able to use the script to determine the folder structure. In this particular case, a new entry in the error log will be created and the filename won't be saved on your custom path. If you need more information regarding the ExecutionPolicy, please see the sample scripts.




Conflict resolution

Conflicts in the target folder

If conflicts arise on saving (e.g. because a barcode appeared twice in a stack) you have the following options:

Solution optionsDescriptionTypical example

Move duplicates to error folder

  • The document is filed in the error folder
The document was preprocessed and the filename already exists

Overwrite duplicates

  • The newer document overwrites the existing document
The document was preprocessed and the filename already exists

Intended file name + consecutive number

  • The document is filed under the intended name but a consecutive number is attached to ensure that the file name is unique
Doubly scanned documents should not be overwritten or sorted out, but instead saved inside the output folder

Conflicts in the error folder

If conflicts arise in the error folder when saving, you have the following options:

Solution optionsDescriptionTypical example

Rename duplicates to "Duplicate" + consecutive number

  • The document is renamed "Duplicate" and is given a consecutive number, to ensure that the file name is unique
The document was preprocessed and the filename already exists

Overwrite duplicates

  • The newer document overwrites the existing one
The document was preprocessed and the filename already exists

Intended file name + consecutive number

  •  The document is filed under the intended name but a consecutive number is attached to ensure that the file name is unique
Doubly scanned documents should not be overwritten or sorted out, but instead saved inside the output folder