Get text and put in a csv

I want to take some text and put it in a csv file
Do you have ideas how to make the robot ?
An example with the activity write csv would be nice
with a get text take all information on the left and put in a csv like this capture
thank you for your help :grinning:

Capture1 Capture2

1 Like

Here is a workflow that you should be able to play with to get what you need. It uses the String.Split method to get each individual line of text by splitting on newline characters, then iterates through the resulting array and splits each line again on the “:” character, taking the first result. Hope this helps.

SplitLines.zip (10.3 KB)

2 Likes

thanks for your return
when I open it I have a problem in the activityCapture3

Update your packages

UiPath.UiAutomation.Activities and UiPath.System.Activities

Thanks,
Prankur

2 Likes

I can not find these packs

thanks
kaj,

Please check in Installed or in Available

1 Like

do you have another method to extract the data on the left side and put it of the csv type as on the top capture

I thank you
kaj,

all ready cheacked

Hi
What version of Studio are you using?

Hi,
Studio 2018.2.3

So that’s the problem then…
The example provided is made in version 2019.1 and there was a major change in version 2018.3 so project after 2018.3 are not backwards compatible… :frowning:

okay I see
can you help me differently
because I’m stuck

I tried to make the file prior 2018.3 compatible.
Try it. Make sure you put it in a separate folder so default dependencies are loaded.

Main1.xaml (6.2 KB)

2 Likes

I still have the same problem
I’m sorry to disturb you as much
it’s possible to have a screen to see which activity to use
thank you so much

1 Like

The activity is ForEach
I think its by default there so you can use it.

What has been done is:
ForEach testArr
inside that use a WriteLine “item.ToString.Split(’:'c)(0)” which gives you the value before ‘:’

hope this helps

1 Like

image

1 Like

thank you very much it works
now I would like to put it in a csv file
I can not use the write csv activity properly

:grinning::grinning:

Right, you will need to build the CSV yourself by adding up in the loop individual items
It could look like:

CsvString = CsvString + if(string.IsNullOrEmpty(CsvString),"",";" ) + item.Split(":"c)(0).Trim

And then use Append Line activity to write CsvString to file.

1 Like