Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import NUL from txt file

Status
Not open for further replies.

micang

Technical User
Aug 9, 2006
626
US
SQL 2000

Hi All,

I have a txt file to import. The first character of each line is 'NUL' - ASCII 0 00

Does anyone know how I can go about getting SQL to reconise this? The only way I have managed to do it is to physically find and replace it to another character (1), then importing it is no problem, otherwise SQL does not reconise this character and therefore does not see any of the data.

Any help will be greatly appreciated.

Michael

PS - Apologies for having posted this inthe programming forum, only saw the DTS forum now.
 
can you open this file using vbScript, and remove the first character from each row?

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Hi Alex,

I can open the file in another app I have called VEDIT. In this I can do a replace or remove the character easily, but the problem is I have 8 huge files (total records amount to 36 million) and it takes quite a while to go and remove or replace the nul for each file.

Thanks

Michael
 
I don't know what VEDIT is, but can you open the file in notepad? If so, you should be able to open it using vbScript. No matter what program you use, replacing the NUL is not going to be fast with that many rows. But the only other option I see is go get a clean file.

HOpe this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Thanks Alex and nice95gle.

I am pretty certain though that this NUL character should be recognisable. The data we recieve from our supplier is also sent to other clients of theirs. I would be surprised if this is the only way around it, but for now and with my skills, I will have to live with replacing the NUL in VEDIT.

Thank you both very much for your input and assistance, much appreciated.

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top