Schema.ini for all textfiles in the folder

K

Kris

Hi,

i try to import several cvs-files into a database.
These csv's are delimited by a "|". (don't ask me why it's named csv
then ;-)

..Net seems to ignore my settings in the connectionstring:

....Properties=""text;HDR=Yes;FMT=Custom-Delimited(|)"""

i get a table with one field like name|street|phone and so on

So i created a schema.ini and it works with one file, but:
in my folder are up to 500 csv-files and im not willing to write all
that stuff.

now here is my question:
is there a way for a global setting for that folder? in schema.ini i
tried

[*.csv]
format=delimited(|)

but it didn't work.

i could read out all names (changing daily) of that folder an create a
schema.ini, but in that case time plays a role and i would be glad if i
coud save this time.

thanks

chris
 
P

Paul Clement

¤ Hi,
¤
¤ i try to import several cvs-files into a database.
¤ These csv's are delimited by a "|". (don't ask me why it's named csv
¤ then ;-)
¤
¤ .Net seems to ignore my settings in the connectionstring:
¤
¤ ...Properties=""text;HDR=Yes;FMT=Custom-Delimited(|)"""
¤
¤ i get a table with one field like name|street|phone and so on
¤
¤ So i created a schema.ini and it works with one file, but:
¤ in my folder are up to 500 csv-files and im not willing to write all
¤ that stuff.
¤
¤ now here is my question:
¤ is there a way for a global setting for that folder? in schema.ini i
¤ tried
¤
¤ [*.csv]
¤ format=delimited(|)
¤
¤ but it didn't work.
¤
¤ i could read out all names (changing daily) of that folder an create a
¤ schema.ini, but in that case time plays a role and i would be glad if i
¤ coud save this time.

Unfortunately you will need an entry for each file. The only possible alternative would be to change
the default delimiter for the Text ISAM in the Registry.

You could also create your schema.ini and entries dynamically using code.

http://www.mentalis.org/soft/class.qpx?id=6


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top