|
|
Up |
|
|
  |
Author: BradBrad Date: Aug 4, 2008 09:35
Here's what my data looks like:
"12312331 ","DOE, JOHN","3423423",0,1900-01-01
00:00:00,"","@@
","","JOHN DOE PROCESSING PLANT"
Here's my format file:
7.0
10
1 SQLCHAR 0 0 "\"" 0 ""
2 SQLCHAR 0 250 "\",\"" 1 "c1"
3 SQLCHAR 0 250 "\",\"" 2 "c2"
4 SQLCHAR 0 250 "\"," 3 "c3"
5 SQLCHAR 0 250 "," 4 "c4"
6 SQLCHAR 0 250 ",\"" 5 "c5"
7 SQLCHAR 0 250 "\",\"" 6 "c6"
8 SQLCHAR 0 250 "\",\"" 7 "c7"
9 SQLCHAR 0 250 "\",\"" 8 "c8"
10 SQLCHAR 0 250 "\"\r\n" 9 "c9"
I even tried simplying it into the simplist form possible because I
kept getting an error...
|
| Show full article (1.45Kb) |
|
| | 4 Comments |
|
  |
Author: Erland SommarskogErland Sommarskog Date: Aug 4, 2008 14:45
> Here's what my data looks like:
>
> "12312331 ","DOE, JOHN","3423423",0,1900-01-01
> 00:00:00,"","@@
> ","","JOHN DOE PROCESSING PLANT"
>
> Here's my format file:
>
> 7.0
> 10
> 1 SQLCHAR 0 0 "\"" 0 ""
> 2 SQLCHAR 0 250 "\",\"" 1 "c1"
> 3 SQLCHAR 0 250 "\",\"" 2 "c2"
> 4 SQLCHAR 0 250 "\"," 3 "c3"
> 5 SQLCHAR 0 250 "," 4 "c4"
> 6 SQLCHAR 0 250 ",\"" 5 "c5"
> 7 SQLCHAR 0 250 "\",\"" 6 "c6"
> 8 SQLCHAR 0 250 "\",\"" 7 "c7"
> 9 SQLCHAR 0 250 "\",\"" 8 "c8" ...
|
| Show full article (1.75Kb) |
|
| | no comments |
|
  |
Author: Linchi SheaLinchi Shea Date: Aug 10, 2008 11:43
Personally, I'd rather pre-process the file to get it into the right format
to avoid using a format file. I find the BCP format file more trouble than
it's worth in most cases.
Linchi
"Brad" wrote:
> Here's what my data looks like:
>
> "12312331 ","DOE, JOHN","3423423",0,1900-01-01
> 00:00:00,"","@@
> ","","JOHN DOE PROCESSING PLANT"
>
> Here's my format file:
>
> 7.0
> 10
> 1 SQLCHAR 0...
|
| Show full article (1.77Kb) |
| no comments |
|
  |
Author: Erland SommarskogErland Sommarskog Date: Aug 10, 2008 14:17
> Personally, I'd rather pre-process the file to get it into the right
> format to avoid using a format file. I find the BCP format file more
> trouble than it's worth in most cases.
|
| |
| no comments |
|
  |
|
|
  |
Author: Linchi SheaLinchi Shea Date: Aug 11, 2008 09:22
This may be a matter of experience and cognitive style, just like the
question of which GUI design is more intuitive.
But the fact you stayed away from it for 8~10 years says a lot about its
usibility already. I like to preprocess a file also because it has the added
value of validating the data in the file, which makes it much easier to debug
data import problems.
> Pre-processing a 1MB is no issue. Pre-processing a 1GB is likely to be.
Pre-processing a 1GB file is really rather trivial these days. Now, if it's
100GB, one may have to think a bit harder. Even there, going through that
file sequentially in one shot shouldn't be a huge issue as long as you don't
try to load the whole thing into memory as notepad likes to do. Considering
the benefit of precisely locate any data format problems during the
pre-process, I'd probably still go with pre-processing it.
Linchi
"Erland Sommarskog" wrote:
>> Personally, I'd rather pre-process the file to get it into the right
>> format to avoid using a format file. I find the BCP format file...
|
| Show full article (2.05Kb) |
| no comments |
|
RELATED THREADS |
  |
|
|
|