Set Variables With Part Of Value Saved In A Column Of Csv

Hi everyone

I am a new Kantu user.
I have been using imacros for 10 years and i feel good but imacros 8.9.7 for firefox is compatibility until firefox 56 and it is not compatible with firefox quantum for this reason i want to convert all macros of imacros into kantu language.

You can help me, I really am at the beginning so I need help and advice to learn the language of kantu.

This is the first question:

Can Kantu extract a part of the value saved in a csv column and set it as a variable?

I Give us an example:

Csv name: database.csv

Csv column 1 Values
Username||||Password||||EMAIL
Username||||Password||||EMAIL
Username||||Password||||EMAIL

delimiter |||| (4pipe)

I need to extract Username and set in variabile MyUsername
I need to extract Password and set in variable MyPassword
I need to extract Email and set in variable MyEmail

With Imacros i use this syntax

’ Csv
SET !DATASOURCE database.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !LOOP 1

’ Variables
SET MyUsername EVAL("’{{!COL1}}’.split(’||||’)[0].trim();")
SET MyPassword EVAL("’{{!COL1}}’.split(’||||’)[1].trim();")
SET MyEmail EVAL("’{{!COL1}}’.split(’||||’)[2].trim();")

Trim split the value inside Column 1 and grab every part with 0 1 2 and save in it variables.

With kantu how can i do a similar function ?

Thanks for help

Have a nice day

Why not store the 3 values in 3 CSV columns?

Hi

I have a csv shared with imacros and with imacros i have already a eval split function.

It’s very hard for me create another different csv, because I use one csv shared to Kantu and Imacros.

I tried some solution in javascript to split the column value similar that code used for Imacros.

Have a nice day

This is the solution, it read csv column, split the value with delimiter |||| and with 0 take the first part.

{
  "Command": "storeEval",
  "Target": "\"${!COL1}\".split(\"||||\")[0].trim();",
  "Value": "MyVar"
},

Best Regards