I have a .txt file that is structured to be a tab delimited file. I would like to upload this file into a variable to pass it into an SQL dataset. My understanding though is I first need to read this file into a datatable type variable in UiPath.
RPADummyData.txt (2.2 KB)
I have uploaded data before by using an Excel application scope and using the read range activity to read what I am looking for but is there a way to do with with a .txt file?
Hi, use ‘Read text file’ activity
The output will be string variable ex: str1
Now use ‘Generate data table’ activity
Double click on the activity , you will landed in a preview text and at the right side you will see options to create text into datatable
Now , copy the data from txt file manually and paste it into the generate data table preview area , this is to estimate how your data is converting by choosing different properties
Check CSV parsing checkbox and Delimiter dropdown as ‘tab’ in the right side and use some other options to check the text is converting into proper data structure
Now create a variable with system.data.datatable type and give that variable as output to the generate datatable activity
I think I am doing all of these steps but I am still getting the error: Incorrect syntax near ‘Date’. My table doesn’t even have a column named Date so I’m not sure why i’m getting this error. I am attaching my .xmal below.
UploadDatabase.xaml (5.6 KB)
I have attached the workflow for you
It is working fine
Now you can use your Database activities inside this workflow to upload the data UploadDatabase.xaml (6.4 KB)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.