Maria99
(Maria99)
September 10, 2021, 2:03am
1
I want to separate file By column Reason Of BC as below.
I want to write data BA No. in another file excel.
Example : Create file excel for reason of BC 106CC
remark If column Total Mobile >=1000 separate file to new file.
From data above can write new excel = 4 file
file 1 = BA No. Reason of BC = 106:CC & Total Mobile <1000
file 2 = BA No. Reason of BC = 106:CC & Total Mobile >= 1000
file 3 = BA No. Reason of BC = 99:Header & Total Mobile < 1000
file 4 = BA No. Reason of BC = 99:Header & Total Mobile >= 1000
File excel (input)
SepFile100.xlsx (10.3 KB)
output :
SpiltFile.zip (22.4 KB)
Please guide me about it.
Srini84
(Srinivas)
September 10, 2021, 4:53am
2
Maria99:
file 1 = BA No. Reason of BC = 106:CC & Total Mobile <1000
file 2 = BA No. Reason of BC = 106:CC & Total Mobile >= 1000
file 3 = BA No. Reason of BC = 99:Header & Total Mobile < 1000
file 4 = BA No. Reason of BC = 99:Header & Total Mobile >= 1000
@Maria99
This can be done by using Filter Datatable also
You can give conditions and output to a datatable that you can write to excel
Hope this may help you
Thanks
This can be simply done using Filter Datatable
Maria99
(Maria99)
September 10, 2021, 4:56am
3
@Srini84 How to filter and write file separate excel?
Srini84
(Srinivas)
September 10, 2021, 4:58am
4
@Maria99
Try with this also
Use Assign activity
Dt = Dt.Select("[Reason Of BC] = ‘106:CC’ And Convert([Total Mobile]),System.int32 < 1000”).CopyToDataTable
Hope this may help you
Srini84
(Srinivas)
September 10, 2021, 5:15am
5
@Maria99
Also, as alternative
DataTableVar = (From d In DataTableVar.AsEnumerable
Where Reason of BC = “106:CC” And CInt(Total Mobile) < 1000
Select d).CopyToDataTable
Thanks
Maria99
(Maria99)
September 10, 2021, 6:14am
6
@Srini84 If I have more reason of BC
Example : 106CC , 99Header ,…
How to edit your linq (Don’t fix details in column Reason OF BC ?
prasath17
(Guru)
September 9, 2021, 12:52pm
8
@Maria99 - Looks like you have already created one post on the same query right? If yes, please do not create multiple post on the same topic…
https://forum.uipath.com/t/write-textfile-from-excel/343864
1 Like
Maria99
(Maria99)
September 9, 2021, 8:20pm
9
Any idea for this case?
Pablito
(Pawel Wozniak)
September 10, 2021, 6:39am
10
@Maria99 ,
You have opened 3 topics for the very same question. This will not help you get answers and help faster as it’s being caught by our spam bot. All topics will be merged into one. Please do not do this next time.
Srini84
(Srinivas)
September 10, 2021, 7:21am
11
@Maria99
Create an array of string with your Reasons
String[]Variable = {“106:CC”,“99:Header”}
Use For Each activity Change the Type Arguments to String , then your linq function will be like
DataTableVar = (From d In DataTableVar.AsEnumerable
Where Reason of BC = Item.ToString And CInt(Total Mobile) < 1000
Select d).CopyToDataTable
Hope this may help you
Thanks
1 Like
system
(system)
Closed
September 13, 2021, 7:21am
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.