FlexiCapture: How to preserve new line during export when exporting to the file


When you recognize the data and there is a text field that consists of multiple lines, when exported to data files, it is possible that the result will be merged into one line.

For example, please refer to the field on the screenshots below.


It consists of 2 lines:


But, when exporting to Excel as is, it will be merged into one line as shown below.



In FlexiCapture, two types of newline escape sequences are used in text fields: 

  1. "\n" - new line, or line feed.
  2. "\r" - carriage return.

When exporting to the data files, they can be changed according to the standards of the output format.


In order to preserve a new line when exporting to the file, we can add a simple AutoCorrect script to the field:


The script:

Value.Text = Value.Text.Replace("\n", "\r\n");

Using the AutoCorrect script will keep new lines when exporting to Excel, as well as other formats.


It is possible that the described method will not work with some of the file formats and text encoding options. In such a case consider using the Custom Export (Export Script) to preserve the needed data formatting.

Have more questions? Submit a request



Please sign in to leave a comment.