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

Symptoms

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.

mceclip1.png

It consists of 2 lines:

mceclip2.png

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

mceclip3.png

Cause

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.

Resolution

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

mceclip4.png

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.

mceclip5.png

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

Comments

0 comments

Please sign in to leave a comment.