I have data in a text file in below format:
Is there any way in which I can read this data and write them in appropriate column names: FirstName, LastName,Phone?
I got following error on trying to split the string at ‘|’
@Santa_Krish The split function gives output of a one dimension array. Please change the datatype of strSpit to Array[string]. This will resolve the error.
you can read the data by using read text file.
split the readable data by using |. for example (Array=sample.split(“|”,c))
Assign variable Array should be one dimension array.
write your value like array(0).tostring, array(1).tostring, array(2).tostring. in the appropriate column name.
did you use Generate DataTable activity?
This sample workflow can help you to do the same. Just check and let me know.
StringOperation.xaml (4.7 KB)
Thanks Sugumar, It works like a charm . Btw can I know the function of NewLine separator property in Generate Data table activity? Is it used to end the current row and fetch next row?
No @Pradeep_Shiv, I was not familiar with this activity before your comment. On googling, found how it can deal with data. Thanks for your help!
You can use ‘|’ as a delimiter. I think you know about CSV, CSV stands for Comma Separated Values. So, when you change your text file to CSV, it uses a comma as a separator. In the same way, you can use ‘|’.
Please refer the attached.---------> StringProcess.xaml (4.7 KB)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.