i want to delete some specific rows in Excel document but i don’t think i can use data filter because rows variables changing all the time.
Ex : Lets say, we have 8 row in A_Column and our datas
AA
BB
CC
DD
…
and i do not want to delete BB and DD row or more
How can i do that?
Thanks.
First of all, i did data scraping and sent to excel, but some datas, i do not want to see and delete from in excel row.
For now, i know which row should i delete but in the future it will be change.
if you know which row variables are relevant you could put the values in config file (in folder Data), for example:
Name | Value
KeepRowValue | BB,DD
You could use “BB,DD” and set comma as a delimiter (String.Split function). Then you have a string array.
Now you iterate over the string array.
With a for each you can check if the correct row is in your data and if the correct row is found, you add the index of the row to the list of integer.
Then you iterate over the list of integer and delete the undesired rows.
Note:
Alternatively you can use multiple LINQ-statements, which is faster and much cleaner.
Firts of all,
thank for your help @supermanPunch and @Smars.
I tried datafilter and it did work. i found a mistake of while reading datas. In datafilter it cannot read the empty space like(Word1 Word2) so i have to join these two words. @Smars Right now, i’m not working with ReFramework structure but thanks for info.