Breaking News

What is the best way to read a text file into a Collection?

What is the best way to read a text file into a Collection?


QUESTION
Blue Prism offers several methods of reading text data into a Collection Data Item.
Although it is possible to read a text file using the MS Excel VBO, this object attempts to determine the data type for the incoming data and to classify it as a text field. If the source data was a date or date & time field then this can be mis-interpreted by the Excel object.
The more reliable method is to use the Utility - File Management VBO.
ANSWER
Using the Utility - File Management object - Get CSV Text as Collection
The File Management VBO has the method "Get CSV Text as Collection". This method works brilliantly at getting comma-separated value text, and works without needing to do any manipulation of the source data. This method correctly interprets the values as a number.
Using the MS Excel VBO - GetWorksheetAsCollection(fast)
Another method is to use the Microsoft Excel VBO and to use its GetWorksheetAsCollection(fast) method to read the file in. This method takes a bit more preparation, and it requires having MS Excel installed on the machine that will execute the Process or Object. However, the advantage is that it reads all the data as text, and is therefore a more reliable for reading source data as pure text without trying to convert the data into a specific data type.

1 comment:

  1. its my Pleasure to read your article are very excellent thanks to give good information Excel utilities


    ReplyDelete