search pattern in fileexist and loadCSV?

schimanski

Well-Known Member
Licensed User
Longtime User
I want to check, if a file, from which i doesnt' have the whole filename (Name + country) , exist and after that, i want to load the file in a table:

B4X:
if FileExist("IMEI country.csv")=True Then .....

Table2.LoadCSV ("IMEI country.csv", ",",False, True)....

I dont't know, how to use search pattern in this commaand...

Thanks...
 

schimanski

Well-Known Member
Licensed User
Longtime User
Thank for answers!

But Klaus, that's not for what I'm looking for. For example, sometimes the filename is "IMEI Düsseldorf.csv" and another time, the filename is "IMEI Köln.csv". So, my application should load the file with the begining of "IMEI" and ignore the following country.
Something like "IMEI*.csv", but this doesn't work.

I don't want to know, how much files with IMEI exist, because there is every time only one file with the begining 'IMEI' and the following different country. And this one, I want to load.....

Greetings....
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Sorry, I don't really understand what you are willing to do.
How is the program supposed to make the difference between "IMEI Düsseldorf.csv" and "IMEI Köln.csv" ? In my mind the city name should be known somewhere.
Or you should use FileSearch, as Erel already suggested. In that case you know if "IMEI *.csv" files do exist. But to load a file you still wouls need the city name.

Best regards.
 

BjornF

Active Member
Licensed User
Longtime User
Dear Schimanski and Klaus,

Couldn't you use FileSearch (alFiles, "\My Documents", "IMEI*.csv") as Erel and Klaus suggested, and then if you know that there is only one IMEI file you use the first (and only) name in the array and open that?

Table2.LoadCSV (alFiles.item(0), ",",False, True)....

all the best / Björn
 

schimanski

Well-Known Member
Licensed User
Longtime User
Much thanks for your answers!

I try your way, BjornF. I think, that it is what i'm looking for...Good idea!
 
Top