Change CSV separator from semicolon(;) to coma(,)

The CSV file that I’m provided with is using semicolon as the separator, is there any way to change it to coma? There’s many lines so I don’t want to edit it manually one by one.

See also Change CSV separator

This feature is on our todo list and we plan to have it ready soon after the V3 conversion.

What is the status of this item?

Besides that, I am a newbie, so kindly bear with me - What is being referred to by “V3 conversion”?

I am using Chrome extension Version 8.1.23. So I am not sure what V3 conversion means.

About CSV.
Here is a workarounds

a;s;d;f;g
q;w;e;r
z;c;v;b
{
  "Name": "readCSV",
  "CreationDate": "2022-12-8",
  "Commands": [
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "csvRead",
      "Target": "sample.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "while_v2",
      "Target": "${!csvReadStatus} == \"OK\"",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "${!col1}",
      "Value": "csv_line",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "/**\nAt this stage u can use JavaScript to parse the string and use data.\nOr , if u need a 'proper' csv file, u can create a new one using 'csvSaveArray'\n*/",
      "Value": "Commment",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "or Write data inrto ",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${csv_line}",
      "Value": "blue",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number(${!csvReadLineNumber})+1",
      "Value": "!csvReadLineNumber",
      "Description": ""
    },
    {
      "Command": "csvRead",
      "Target": "sample.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

@Eltal - Thank you for taking time to sharing the script - really appreciate it.

The problem I have is that my data has commas in them - so the workaround doesn’t work for my scenario.

For that reason I was hoping to be able to change the default separator used by UI.Vision.

do u mind to provide a sample of the data File

I am not importing a data file - but generating a CSV file based on automation of a web page extracting elements using “storeText” command command

The problem is that the text some times has a comma in it, that is throwing off the alignment of CSV columns.

Now that you asked, I am realizing that the text could have any separator that I pick - so I will have the same problem no matter what separator I pick (assuming UI.Vision enables the feature for users to pick a separator).

hmmmm … I guess I will need to parse the string returned by “storeText” and replace any occurrence of the separator symbol (as of now comma) with some pattern like (say [COMMA]) so that I can do post processing if/as needed.

Any suggestions on how to do it?

Actually, that is something that will do.
Use JavaScript replace(/\,/g,'[COMMA]')

1 Like

alternatively look in to saveaArray

Is there a typo here?

I couldn’t find any documentation on “saveaArray”.

image

Documentation
https://ui.vision/rpa/docs/selenium-ide/csvread#array

Existing limitation