File Cleaning

Introduction

The file import process includes a number of optional steps, in the import process, that can clean up a file and make the importing easier and the payment flow through the system more efficiently.

When File Cleaning Takes Place

File cleaning takes place after the file is imported and before the pre-processing stage.

Pre-Processing path

File Cleaner Rules

The file cleaner can modify files to help the importing stage. Various tokens have been identified that represent common ASCII code found in text files. The following table identifies and describes these tokens:

Token Meaning ASCII (Decimal)
Null ASCII Null 0
CR Carriage Return 13
LF Line Feed (Linux Default) 10
CRLF Carriage Return Line Feed (Windows Default) 13, 10

The Rule process allows you to modify the file to either remove or replace various ASCII codes from the file. For example, some systems may produce a text output that contains ASCII nulls. These characters can be invisible when viewing the file in say Notepad, but can often affect the import file reading process that could result in BACS validation or submission errors. In this scenario, click ‘Remove ASCII Nulls’ will silently remove all ASCII null characters from the imported file.

The other rules (Convert LF to CRLF, etc ) modify the row delimiters used in the file. This can be to import files that have been created on different operating system or so correct files that have inconsistent row delimiters.

Convert to Upper Case

Ticking the ‘Convert to Upper Case’ box will cause the importer to convert all lower case characters, in the file, to the corresponding upper case character. This is useful for BACS submissions that only allow uppercase characters.

Remove ASCII Nulls

Ticking the ‘Remove ASCII Nulls’ box will cause the importer to strip ASCII Nulls (ASCII Code 0) from the file.

Convert XXX to YYY

These rules are used to change the end terminators used in files. They are useful for when a file has been originally created by a system on various operating systems such as Linux or Unix. Converting a file to use CRLF provides the most compatibility with paygate,

Convert To UTF-8

Ticking the ‘Convert To UTF-8’ box will cause the importer to convert the file being imported into UTF-8 format. This can fix a large amount of file import problems. If you find the importer is having problems importing a file that looks normal in Notepad then try ticking this box.

Character Set

File cleaning ensures that the file only contains characters that are supported by a particular payment system. Currently this is automatically set to BACS.

Character Substitution

An importer can automatically swap or substitute characters in the incoming file. This can be useful for repairing files generated on different system so that they are ready to be read into a payment system with a script character set such as BACS and Faster Payments.

Adding a Substitution Rule

In the file Cleaner section click the button marked ‘Substitution’.

Substitution

This displays the substitution rule list. The rule list will be empty if you haven’t added an rules yet.

Substitution

Click ‘Add Rule’. You now enter the character you want to change to the from box and the character you want to substitute it with in the To box.

Substitution

In this example we want to substitute the @ symbol with an ‘A’ character.

Add more rules to substitute other characters if required. Individual rules can be enabled or disabled as required. A disabled rule will not run during import. Finally, to remove a rule click the red X button.

Once you have finished adding rules, save the importer using the ‘Update’ button at the foot of the page.