How can I convert write line output to an array?

Using UiPath 2019.3.0 Community my objective is:

* Read a DIR

* Get a list of .LOG file names

* Open Notepad++

* For each item in the array:

* Open the file

* Save as XML

* Save file name as the same name as the array, without the '.LOG'.  From the videos on Academy, my first thought is to use the SPLIT function before the '.'?
  • Close the file, move to the next item in the array

I used the example from UiPath Academy to read a directory and display the file names.

  1. How can I convert the output to an array?
  1. Use “item.fullName” property to get the full path of the file. You’ll also see the extension of the file in this.
  2. Now for each file, use Move File activity and specify the current file path in the “Source” field.
  3. In the “Destination” field, specify the destination directory along with the file name and the extension (.xml in your case).

Try this!

1 Like

Hi Jagdish,

Thank you for your response. Can you explain how to use “item.FullName”? I tried to put it in the “ForEach” and “Write line” and it didn’t work.

I’ve been searching the form for “item.fullName” and can’t seem to find a topic that answers my question. Is the “ForEach” item already considered an array?
Do I even need the array?

If anyone knows of an existing example they could point me to that would be great. Still learning to navigate the forum.

1 Like

Filename = item.tostring , this itself will give you name of the file, you don’t need to use item.fullname

1 Like

Thank you


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