Split from CSV and stored in variable

Hi,
i’ve a CSV file like this:

Name";“Surname”;“Company”;“Address”;“IDType”;“Name”;“Surname”;“Company”;“Address”;“IDType"Name”;“Surname”;“Company”;“Address”;"IDType"
and repeat for 100 rows.

My question is: how can i iterate this CSV and store Name in varName, Surname in varSurname etc.?

Thanks in advice

1 Like

Fine
Is this the actual format
Or will there be any value between Name and Surname so that can be fetched
Cheers @andreus91

1 Like

Hi @Palaniyappan
There are value instead of Name, Surname, etc. and I would like to store them in a variable without the "quotes"

1 Like

Up please

1 Like

Fine
If it’s in a structured way,
Is it getting converted to datatable on using READ CSV FILE
Cheers @andreus91

1 Like

The first things i did READ CSV then i erase the “quotes” with replace activity and third operation was split function because the value was separate by “;”
Now i have an array of string with the element and i’ll try to store in a variabile and TYPE INTO a cell…
But how can i do that?

Awesome
So may I know how it looks now that is the format
@andreus91

1 Like


In output you can see the value trough a write line item.tostring of the array.
Thanks

1 Like

So we need to take four values from array and next four values from array
So for that use a while loop and mention like this
counter < arrayvariable.Count
Where counter is a variable of type int32 with default value as 0
And inside the loop use a set of Assign activities like
In the first assign activity
Str_name = arrvariable(counter).ToString
Str_Surname = arrvariable(counter+1).ToString
Str_company = arrvariable(counter+2).ToString
Str_address = arrvariable(counter+3).ToString
—now we can use set of activities to use the above variables then atlast inside the while loop use another assign activity like this
counter = counter +4

Cheers @andreus91

1 Like

I’ll have to make some adjustments but that’s what I was looking for.

Really appreciate your help! @Palaniyappan

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.