I want to convert txt and write it in excel.
text.txt (137 Bytes)
I want copy in column Flag_RM_Return = B only
And Write in file excel ( write next row from input file)
File Input as below. Ex code Lot.xlsx (18.5 KB)
I want to copy data from text file to file input as below.
*write in Column Status if column Flag_RM_return = B —> write text ตัดออก
Please guide me about it.
1 Like
Gokul001
(Gokul Balaji)
February 1, 2022, 4:37am
2
Hi @fairymemay
we have an activity called Generate DataTable activity
where we can pass the text, a string variable as input and get the output as DataTable which can be written to a excel with write range activity
Have a view on the doc for more Info
https://activities.uipath.com/docs/generate-data-table
Hope it will help
Regards
Gokul
@Gokul001 I don’t know how to write in column Status = ตัดออก ?
Gokul001
(Gokul Balaji)
February 1, 2022, 5:03am
4
Have a view on the thread
Hi @syaheed22
please find attached code which will convert text file data into excel headers.
Steps Included
Read data from text file.
Split data by using split function delimiter as Environment.Newline which will return array.
Assign New Datatable() to the Datatable.
Use for each loop with add data column activity to add data to datatable as column.
add a single datarow to datatable.
Write range into excel file with Add headers option check.
TextToExcel.zip (16.3 KB)
Regards,
Vijay Kumar…
Hope it will resolved your query @fairymemay
Regards
Gokul
I can’t understand how to work it?
Please guide me or example flow for solve this case.
Gokul001
(Gokul Balaji)
February 1, 2022, 5:54am
6
Can you share the Input text file and xaml workflow @fairymemay
Gokul001
(Gokul Balaji)
February 1, 2022, 6:49am
8
Hi @fairymemay
Have look into the screen shot
Use Generated Data Table Activity
Regards
Gokul
@Gokul001 And how to write append in file input and write column Status = ตัดออก ?
Gokul001
(Gokul Balaji)
February 1, 2022, 9:02am
10
You Need to return the status in the Excel or text file?
Regards
Gokul
@Gokul001 In excel file input
Gokul001
(Gokul Balaji)
February 1, 2022, 9:09am
12
Do you have any condition for returning that specific status?
If yes you can try like
Read Range the excel file store in the Datatable
Loop through the Datatable
If row(“Flag_RM_Return”).toString = “B” (Think so this is the condition)
then - The processs you need
else - the process you need
Regards
Gokul
1 Like
@Gokul001 write data from text file to in file output next line in latest row ( column NO , Flag_RM_Return And write column Status = ตัดออก )
Gokul001
(Gokul Balaji)
February 1, 2022, 9:20am
14
Query is not understandable can you elaborate please?
Regards
Gokul
Hi @fairymemay ,
Can you flow the below steps.
Read the text file using Read Text File activity.
Use Generate Data Table activity and set the options with reference to the below screenshot.
Format as CSV
Column Separator as “|”
Enable the First row as Column Headers
Send the read text activity variable as input to the Generate Data Table and output of this table, use the write range to see the resultant in the excel.
For your reference, a sample XAML workflow is shared.
FairymemayText2Excel.zip (6.4 KB)
Regards.
@90s_Developer
2 Likes
system
(system)
Closed
February 4, 2022, 9:52am
16
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.