Hi everyone, I need a hand for my problem. in practice I would like to select a certain number of columns on excel starting from the index a starting column. someone could help me with my problem
thank you very much for the attention.
fahad
Hi everyone, I need a hand for my problem. in practice I would like to select a certain number of columns on excel starting from the index a starting column. someone could help me with my problem
thank you very much for the attention.
fahad
Will you please elaborate your problem ?
Hi @momi_fede plz remember to give some examples
I think you can solve your problem with:
If you need to add more subgroups of columns you can add more ".concat(row…)
i wish it helps
for example: I would like to select the columns underlined in blue starting from the column underlined in red
PS. the columns I want to select are unknown
could I kindly ask you for an example? @Ignacio_Insua_Feito
yes give 10 secs:
In case you need something more complex for example getting C and E to G
i cant send you a xaml example :S sorry.
of course!! thanks for your help
if you want to select the D cell to H cell means , simply use Read range and in the given range area ,mention the range as D:H.
thanks for your answer!! can you also tell me how I can be sure that you are doing this function?
Hi @momi_fede
Some basic explanation to enable you to use LinQ.
Thats why i use dataTable.Rows.Cast(of DataRow) in order to transform a rows collecion to a List type object.
LinQ Functions:
Select/Where/Any/First/Last/skip/take/groupby
All of them must be build as .NameFunction(function(variableNameForEachItem) function to be evaluated)
NameFunction should be one of the functions Select, Where etc…and his type is the same as the data inside the list
The funcion should be a function that results in expected value (type:depends of the function used) and will be evaluated for each row.
The result will be different for each function
First/Last will give you one of the items in the list. the function inside could be empty or be a boolean expresion
Where will give you a list of the items in the list. the function inside must be a boolean expresion
Select: Allows you to transform each line and you can give back any data type and will return a list of objects
Skip/take allows you to take/skip a number of items of the list
Once i explain almost every option in case you need to try your result:
Some usefull expresions to evaluate the results of the expressions explained before are:
message box activity with the next funcionts inside
string.join(Environment.Newline,list.Select(function(row) string.join(“;”,row.tolist) this will print all items in the list in different lines whit all columns separated by commas.
list.Count – number of items
string.join(“,”,list.FirstOrDefault) – the first item separated by commas.