|
|||||||||
|
|
|||||||||
|
General Tech General discussion for tech related things that don't fit specifically in one of the categories here. Talk about gadgets in here too! |
|
||||||
![]() |
|
|
#1
|
||
|
||
|
Loading a text file into Sql Server
|
| Join GeneralForum.com Today! |
Join GeneralForum.com today for FREE!GeneralForum.com is the fastest growing general forum on the web!
» Click here to join the fun! |
|
#2
|
|||
|
|||
|
Can you post a sample few lines from the file? That way I can see exactly what you mean. Just edit out important information with XXXXX if necessary when you post it. Thanks.
|
|
#3
|
||
|
||
|
Here's a sample. (data may have wrapped to another line) There can be more than 20 pages in the file. Each line in the file is loaded as a row in the table. The order is important because information for a customer is grouped in the 5 lines beginning w/ the one above My NAME. I look for keywords and take information from 3 of the lines to use in subsequent steps. If they aren't loaded in this exact order, customer information gets mixed up. Sometimes the file loads properly, but usually it doesn't (eg. Part of page 3 is loaded before the beginning of the file, etc). Could it be a buffering problem?
PageHeading1 :06-04-2006 DATE:06-04-2006 TIME:12:39:36 PAGE: 1 Report Title Report date 06-04-2006 Other Heading Line T TYPE CODE AMOUNT DATE TIME Rep Comment ---------------------------------------------------------------------------------- Q XXXXXXXXXXXXXXXXXxxxxxx 21.36 06-04 11:36 028287 xxx xxxxx xxxxx xxxx xx xx xxx My NAME : Joe Smith My Customer# : 12345678 My zip code : 12345 My email : xxx@xxx.xxx C XXXXXXXXXXXXXXXXXxxxxxx 10.00 06-04 11:36 028288 xxx xxxxx xxxxx xxxx xx xx xxx My NAME : Bob Smith My Customer# : 213456789 My zip code : 23456 My email : xxxx@xxx.xxx G XXXXXXXXXXXXXXXXXxxxxxx 24.46 06-04 11:36 028289 xxx xxxxx xxxxx xxxx xx xx xxx My NAME : Roger Smith My Customer# : 34567 My zip code : 44646 My email : xxxxxxxx@xxxxx.xxx H XXXXXXXXXXXXXXXXXxxxxxx 31.95 06-04 11:36 028290 xxx xxxxx xxxxx xxxx xx xx xxx My NAME : Sue Smith My Customer# : 98765 My zip code : 49876 My email : xxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxx.xx Q XXXXXXXXXXXXXXXXXxxxxxx 21.16 06-04 11:36 028291 xxx xxxxx xxxxx xxxx xx xx xxx My NAME : Nancy Smith My Customer# : 87654 My zip code : 43522 My email : xxxxxxxxxxxxxxxxxxxxx@xxxxx.xxx F XXXXXXXXXXXXXXXXXxxxxxx 39.00 06-04 11:36 028292 xxx xxxxx xxxxx xxxx xx xx xxx My NAME : Terry Smith My Customer# : 22732 My zip code : 33511 My email : xxxxxxx@xxxxxxxxxxxxx.xxx |
|
#4
|
|||
|
|||
|
What are you using to import the data? It looks pretty standard from what I can tell..
|
|
#5
|
||
|
||
|
I'm using a DTS package in SQL Server 2000. I also tried to load it using the DTS wizard and get the same result - sometimes it loads ok, sometimes it doesn't.
|
|
#6
|
|||
|
|||
|
Are you able to break it up into multiple files and import them individually? It might be that the file is too big and is using too many system resources when importing it.
|
|
#7
|
||
|
||
|
No, it can't be broken up into smaller files. Could it be a buffering problem? The DTS pkg had a row size of 8000. I switched it to 255 & played around w/ other numbers, but it didn't seem to help.
|
|
#8
|
|||
|
|||
|
Are yo just tring to place the info in the correct place? so you can search for it later?
|
|
#9
|
||
|
||
|
I'm trying to load the text file in the original order so I can search for keywords to extract information on different lines for a particular customer. Customer information is grouped together over several lines, so I need it to be in the order it occurs in the text file
|
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|