473,395 Members | 1,412 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,395 software developers and data experts.

HOWTO import *long* text fields from a csv file ?

Hi. I got a "|" delimited file, and one of its columns (the last one)
is MANY chars long.

If I use my try to manually import the file, the text in the last
column is cut off at char 255, as it should.

I have tried to import it by code - I have created a target table in
Access where the "LongText" field, the last one, is of type Memo. Then
I have tried to open the text file with an OpenDatabase command, then
go thru the recordset returned by Opendatabase, and for each record
build a query string like "Insert Into Table1 values (.....)", but the
problem is that my OpenDatabase(Dir, FileName..) line does not work
properly - all 4 fields are all together in my first field, Fields(0),
while the last three fields are empty - this is because of the "|"
delim, I suppose, because the code runs fine when trying a ","
delimited table.

How can I import such a file, please (by code or manually) ?

Thanks a lot.
Alex.

May 25 '06 #1
2 6467
YOu can actually do this pretty easily, using the first method you were
trying, with one trick:

Go ahead and do the import, suffering the loss of the characters in the long
field. Now open the imported table and delete all the rows. Put the table
in design view and change the field that needs to be bigger to a Memo field.
Save and close the table.

Re-do your import, but this time be careful to APPEND to an existing table,
not create a new table. You will wipe out your change. When you export,
appending to the existing table, with the Memo field you created, you'll get
your long text, assuming it's less than 32K characters. I think that's
still the limit of a memo field.

There's another way, actually easier, that gets it done in one pass, if
you're comfortable with the import dialog. In the first screen of the
Import Text Wizard there is a button at bottom left called "Advanced".
Click that to open a specification where you can force the kind of field you
want during the import. If your file has no field names on the first row,
and there are lots of fields, this can be hard to use. (Hmmmm...was it F23
or F24 that needed to be longer?)

ANyway, one of these will certainly do the job.

Rick
May 25 '06 #2
Thank you very much. That did the trick :-))

Alex

May 30 '06 #3

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

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
1
by: Sven | last post by:
Hello, I am receiving a text file that is produced from a mainframe that is out of my control. I am attempting to find a (hopefully clean) way to import it into a SQL Server database in an...
1
by: DCM Fan | last post by:
Access 2K, SP3 on Windows 2K, SP4 All, I have an import spec set up with quoted Identifiers and comma-separated values. The text file is produced by a 3rd-party program of which I have no...
1
by: mark | last post by:
In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time...
5
by: Johnny Meredith | last post by:
I have seven huge fixed width text file that I need to import to Access. They contain headers, subtotals, etc. that are not needed. There is also some corrupt data that we know about and can...
4
by: Steve Jorgensen | last post by:
I'm restarting this thread with a different focus. The project I'm working on now id coming along and will be made to work, and it's too late to start over with a new strategy. Still, I'm not...
0
by: NewbieSupreme | last post by:
I'm using PHPMyAdmin on an Apache2Triad install (latest version; 5.x.x, which installs PHP5 and PHPMyAdmin 2.8 as well). In Access, I exported a table to a text file, tab-delimited, text qualifyer...
1
by: Child of His | last post by:
I have been through every trick I know, or has been suggested. I have a one to two million line fixed field database in text format. I want to bring it into Access 97. When I use the external...
11
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.