Find these files using reference

Hello guys !

I need help, I work with invoices and xml, and especially with xml. the xmls that work are in a folder with several xmls, and all have date and numerical sequence,
example; 20210908_3521096800600000007550030000040001010000000,
but I would like to know if there is any possibility of locating these files using this reference numerical; 3521096800600000007550030000040001010000000 ?

Is this a constant number which will be on all the files??? You can try like this…


each file changes this sequence, every day some clients send 100 xmls, but only invoice 30-50 xmls, but these clients only send me numerical sequence in excel. to intend uses For Each Row in Data Table. but I’m having this problem to identify only with numerical sequence


@Luan_Carvalho_Da_Conceica - can you give some sample file names? Also I didn’t get your requirement clearly is it possible to explain with few more examples?

I have this folder, all xmls

list you receive from the customer

as this base that the client sends, I want to find the corresponding files with this numerical sequence

@Luan_Carvalho_Da_Conceica - Got it…Please check this…

Inside your For Eachrow in datatable…You have to look for each files in the directory using Directory.getfiles matching your sequence…

  Directory.GetFiles("FolderPath","*" +row ("DANFE").tostring + "*.xml")

Hope this helps…

Thank you friend !!

If one day you show up in Brazil I’ll buy you a drink hahaha

Already and the second time you’re saving me…

1 Like

Good morning @prasath17 !

Friend, this for aech process is always true due to the directory, do you have any tips, for it to also bring the false value?

sorry I didn’t get you what you mean…

that directory expression, it always brings the value true, I forced it to bring a false value by if, but it always brings the value true, I was wondering if there is any alternative for it to bring a false value.

google tradutor…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.