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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comma/Tab Delimited Text File

Status
Not open for further replies.

bpitche

MIS
Mar 13, 2001
43
0
0
US
I am using ADO to query a comma delimited text file. I have run into a problem. Some fields that I am using, have a comma(,) or quotes (to represent inches) in them. This is breaking up the one field into two or more fields when the records are diplayed in a Flex Grid. Any suggestions?
I also tried this with a tab delimited text file and it does the same thing!!

Thanks in advance!!

Brad Pitcher
The Hoover Company
bpitcher@hoover.com
 
How are the text files created? Yopu would have to replace the comma in the text field with a different character.
 
I know how to replace the comma with a different character, but how to do I read that character in VB. Here is my code to open the recordset:

******************************************************
Dim TextPath As String
Set conn = New ADODB.Connection
TextPath = "c:\INDIRECT\"

conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & TextPath _
& ";Extended Properties='text;" _
& "HDR=No;FMT=Delimited'"
conn.Open

Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.Open "Select * from [inDMST.txt] where 1 = ", conn

Set Adodc1.Recordset = rst
*******************************************************

I also have an ini file called schema.ini which looks like the following:

[inDMST.txt]
ColNameHeader=False
Format=TabDelimited
MaxScanRows=25
CharacterSet=OEM
Col1=Itemnum Text
Col2=Description Text
Col3=Description Text
Col4=Description Text
Col5=Location Text
Col6=Category Text
Col7=SecRow Text
Col8=Binnum Text
Col9=Drawer Text
****************************************************

Thanks,

Brad Pitcher
The Hoover Company
bpitcher@hoover.com
 
I meant when you are writing the file you would have to replace the commas that aren't suppose to be the delimiter.

 
I'm sorry!! I am writing the file from an oracle database. I will have to look and see if there is a "replace" command that I can use. Do you have any ideas on what I can do?

Thanks,

Brad Pitcher
The Hoover Company
bpitcher@hoover.com
 
not sure about oracle statements....sorry....but it looks like your moving in the write direction.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top