![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I need to transfer comma separated data from about 1000 text files to a database. I've looked into BCP, DTS and also tried to create a .bat file. DTS works fine, but to sit down and run through this process for each and every text file is going to be a mission. BCP- I don't have format files, only the data files, and therefore cannot create the appropriate tables and fields. Ideally I would like a .bat file that will call dtsrun.exe which will read the text files, get the number of fields and types of fields required and |
|
Once this is complete, it will loop to the next text file, until the loop is complete. Has anyone come across this before, and is there a simpler approach to this problem, that I missed out. Your assistance is much appreciated |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Hi guys, One thing you could do is to loop through the file names using Perl, build the string on the fly (since Perl doesn't care about string lengths, etc.), |
|
Regards, John Miceli, MCDBA |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Hi Guys, Thanks for your time, I've been asking around, and was told that I can get some software eg. awk that will read the text file and determine the amount of commas up until the |
|
With regards to the data type, I'm planning on setting all the columns to varchar 255. Hope it works!! John - I'm not to good with Perlish, didn't use it before. |
![]() |
| Thread Tools | |
| Display Modes | |
| |