Phoenixxx
(Phoenixxx)
June 17, 2019, 4:41pm
1
Hello my dear friends,
I have this INSANE issue. But first of all let me explain:
I have and excel sheet with 88 columns
I want to extract 6 columns from it with the specific names, because the order of the columns changes every time
I have tried multiple methods method:
3.1. dt.Select(“[CN]” + “” + “[CN1]” + “” + …
3.2 . dt.Select(“CN” + “” + “CN1” + “” + …
3.3. dt.Select(“CN” + “CN1” + …
3.4 And all the other tipes with ’ and “”
If you can please help me.
Apologies for the tag, because my version is 2018.2.3, but I didn’t find more relevant topic.
Regards,
Phoenix
AshwinS2
(Ashwin S)
June 17, 2019, 4:47pm
2
Hi @Phoenixxx
U can use dtout.Select(“[Id]=”+customerid.ToString+“”).CopyToDatatable()
Instead of spaces and blanks
Thanks
Ashwin S
Phoenixxx
(Phoenixxx)
June 17, 2019, 4:51pm
3
Hey @AshwinS2
Thank you for the fast reply.
customerid is the name of the second column. it is not a variable.
I am missing something basic, I think?
BR,
Phoenix
pratikg
(Pratik Gaikwad)
June 18, 2019, 7:54am
4
Hi @Phoenixxx
You can use DataView to achieve this.
Sample code is attached for your reference.
SelectColumn.xaml (10.4 KB)
Thanks,
pratik
1 Like
ImPratham45
(Prathamesh Patil)
June 18, 2019, 10:10am
5
@Phoenixxx per my understanding you want to extract only those 6 columns into 1 dt. If yes then
You can use the below
Dt.defaultview.Totable(False,“ColumnName1”,“ColumnName2”)
If not then can you explain it
1 Like
Phoenixxx
(Phoenixxx)
June 18, 2019, 10:54am
6
Much appreciated @ImPratham45 . Thank you a lot!
system
(system)
Closed
June 21, 2019, 10:55am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.