Search code examples
imacros

How to read data from csv file that has line breaks


I have example data in csv file

  1. Some text
  2. Text 2
  3. Text 3

I want to output it with line break into text area, but getting error when trying to put it as it is. it works only when i remove line breaks

iimPlayCode('ADD !EXTRACT {{!COL1}}\n');
var description = iimGetExtract(1);

Solution

  • Edit your csv file by adding double quotes:

    "1. Some text
    2. Text 2
    3. Text 3"

    And run the code:

    iimPlayCode('SET !DATASOURCE yourfile.txt\nADD !EXTRACT {{!COL1}}');
    var description = iimGetExtract(1);