473,378 Members | 1,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Read tab delimited text file

How do you read a tab delimited text file? The file has 3 colums of data.

I can read fixed width text files using the left and mid functions.

I had rather not use transfer text and import specs.

Nov 29 '06 #1
4 8298
Is the tab character in the file a consistent number of spaces? If so, you
could try using the functions Len() and Instr():

FirstPart = Mid([Input],1,Instr([Input]," ")-1)
SecondPart = Mid(Mid([Input],Len(FirstPart)+6),1,Instr(Mid([Input],Len
(FirstPart)+6)," ")-1)
ThirdPart = Mid([Input],Len(FirstPart)+Len(SecondPart)+11)

Karl wrote:
>How do you read a tab delimited text file? The file has 3 colums of data.

I can read fixed width text files using the left and mid functions.

I had rather not use transfer text and import specs.
--
Message posted via http://www.accessmonster.com

Nov 29 '06 #2

"kingston via AccessMonster.com" <u27511@uwewrote in message
news:6a0437f5b6755@uwe...
Is the tab character in the file a consistent number of spaces?
Its not.
If so, you
could try using the functions Len() and Instr():

FirstPart = Mid([Input],1,Instr([Input]," ")-1)
SecondPart = Mid(Mid([Input],Len(FirstPart)+6),1,Instr(Mid([Input],Len
(FirstPart)+6)," ")-1)
ThirdPart = Mid([Input],Len(FirstPart)+Len(SecondPart)+11)

Karl wrote:
>>How do you read a tab delimited text file? The file has 3 colums of data.

I can read fixed width text files using the left and mid functions.

I had rather not use transfer text and import specs.

--
Message posted via http://www.accessmonster.com

Nov 29 '06 #3
Copy the tab character from the file and paste it into the function Asc():

?Asc("tab character here")

Then use Chr(result) to find the tabs in the file.

Karl wrote:
>Is the tab character in the file a consistent number of spaces?

Its not.

If so, you
>could try using the functions Len() and Instr():
[quoted text clipped - 8 lines]
>>>
I had rather not use transfer text and import specs.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

Nov 29 '06 #4

Karl wrote:
How do you read a tab delimited text file? The file has 3 colums of data.

I can read fixed width text files using the left and mid functions.

I had rather not use transfer text and import specs.
I'm baffled. Why not use import specs? Does your data not import
correctly if you use them? Seems the quickest and least painful way of
doing things. if you wanted to do things the hard way, I guess you
could read the file (check out LineInput) and then split it using Split
and then write the individual values into a record, but this seems like
an awful lot of work when the import spec will do exactly the same
thing and faster. So I suspect there's something you're not telling
us...

Nov 29 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JStrummer | last post by:
Any recommendations on how to generate an INSERT SQL script for the records in a tab-delimietd text file? The limitation is that, while I do have command-line mySQL access locally, I do not at my...
1
by: nunYa | last post by:
I am trying to use the DoCmd.TransferText method to export an access table to a Tab Delimited Text File. I have put the code behind the onclick event of a button and keep getting the error...
1
by: Dixie | last post by:
I have a copy of a tab delimited text file that was created from an excel spreadsheet. I want to try to emulate this text file using Access 2000. I don't have access to the spreadsheet, but do...
2
by: Kenneth Koski | last post by:
Hello All, I have a comma delimited text file, which I would like to move into a SQL 2000 table . I created a DTS package in SQL Server and saved it as a VB.bas . I am writting the code in C#...
1
by: The Bear | last post by:
I have populated a dataset with a tab delimited text file. When the changes are made in the dataset, I then want to write those changes from the dataset to a tab delimited text file. How do I write...
0
by: TJS | last post by:
attempting to read a delimited text file into a dataset using oledb text file connection getting this error message when trying to open connection...
3
by: Avi | last post by:
I need to create a text file that has the data from the 10 tables in the database. The number of fields in the tables exceeds 255 and so I cannot make a new table with all the fields and then...
4
by: JustSomeGuy | last post by:
Hi. I have a comma delimited text file that I want to parse. I was going to use fscanf from the C library but as my app is written in C++ I thought I'd use the std io stream library... My Text...
1
by: Stefan Behnel | last post by:
Gibson wrote: Use iterparse() instead of parsing the file into memory completely. untested: for _, item in etree.iterparse('catalog.xml', tag='Item'): # do some cleanup to save memory...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.