cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch data separated by Tab into collection from Text File

PriyankaAuti1
Level 2
Hi ,   I need to Fetch data from text file into Collection and data in text file is separated by Tab . Please suggest some idea. Thanks in Advance .
5 REPLIES 5

John__Carter
Staff
Staff
Te OLEDB VBO can read different data sources, depending on the inputs you provide it. Here is an example of reading an Excel file https://help.blueprism.com/1136332732 And https://www.connectionstrings.com/textfile/ is a good resource for alternative connection types, including text files.

Mustafa_UlasYig
Level 6
Hi Priyanka_auti If you have horizontal tab separated values, like e.g. ""1    2    3    4    5    6    7    8    9    10""  you can also alter the text to replace those horizontal tabs with e.g. commas, like such: Calculation stage with expression: "" Replace([Data1]; Chr(9); "", "")  "" , where [Data1] contains your horizontal tab string, and output this to the same or another dataitem. ""Chr(9)"" is the ascii charater for horizontal tab, you can see the ascii characters here:https://theasciicode.com.ar/ascii-printable-characters/lowercase-letter-a-minuscule-ascii-code-97.html . The function Chr(Code) is a function in e.g. the calculation stage. You can then input this csv to the ""Utility - Strings"" BO's action ""Get CSV As Collection"", which will give you a collection. If you need to set the collection's column names from the first row, this will require you to programmatically alter the [Data1] dataitem with a linebreak, so that you can use the ""Utility - Collection Manipulation"" BO's action ""Set Column Names From First Row"", to set the first row to be the column names in your collection. Good luck. BR, Mustafa

PriyankaAuti1
Level 2
Hi ,   Please suggest how can i replace tab separated data by comma. Thanks.  

PriyankaAuti1
Level 2
Hi Mustafa,   Thank you for update. I have input like :  1     2    3    4  5     6    7     8  8     9     5     3 and  want to store this data from text file to collection 

Mustafa_UlasYig
Level 6
Hi Priyanka_auti Please see attached BO to see how I would have solved it, the ""Utility - Strings"" BO's action ""Get CSV As Collection"", did not work as I intended it to. So instead I used  ""Utility - Strings"" BO's action ""Split Text"". Please see attached file. Good luck. BR, Mustafa