Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: WARNING MESSAGES


Message #1 by yakov_shlafman@p... on Mon, 8 Jan 2001 09:46:57 -0500
--0-850091740-979315642=:69433
Content-Type: text/plain; charset=us-ascii


yakov

As you realise there isn't really a such a  thing as a standard text file.

One problem is that sometimes their may be locale differs

 it can sometimes happen with between different machines

or between countries. One character which is innocent in at the source is 

unacceptable at the receiptent end.

So how do we get at this character that BCP is seeing as EOF.

I don't know the source of your file.

I don't of course know what resources you have to hand.

If you have access to VB or  VBA application then try the following.
dim counter, position

Open "source.txt" For Input As #1

Open "output.txt" For Output As #2 ' Open file.

Open "position.txt" For Output As #3 ' Open file.

counter = 1

position = 0

Do While Not EOF(1)  ' Loop until end of file.
if counter = ???? ' the record before your problem?

     exit do

        Line Input #1, rec1 ' Read line into variable.

        position = position + len(rec1)


         Print #2, rec1
        counter = counter +1

 

Loop

dim str as string

str = " Position = " & position

Print #3, str

close #3

close #2

close #1

now this gives you a clean half of the file plus a file position marker 

Now opening the source in binary you can jump to the position before the problem

Now it is up to you but I suggest that you input character by character using a Watch

to see which byte is creating your problem. Include a counter in your search

Now if the file can be fixed its easy the position plus the counter is the byte that needs fixing

and you can do that by opening the file in binary and printing a character at that point.

fixing the problem until next time!!

As you know BCP can be programmed but it may be better to have a quiet word in the 

direction of your source file supplier because if it happens once it will happen again!

Hope this helps you to identify the problem an correct it.

Roland


  Luis Alvarez <luis_alvarez@y...> wrote: 
yakov:
Roland question about what type of file BCP is using
is vital to understand the problem. I had that same
proble with txt delimited files.

Luiws




---------------------------------
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!

  Return to Index