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

How can I import CSV with Carriage Return?

Hi, I have a set of comma delimited values in a text file. They import
fine. However, they are all in one record. How can I get each value
on one record? For example, say I have:

toys, books, shoes, houses

If I import, I get them all on one row.

I want each one on a separate row:

toys
books
shoes
houses

Any ideas?

Thanks for any help.

Mar 10 '06 #1
2 5103
On 9 Mar 2006 19:38:38 -0800, ne***********@gmail.com wrote:

You would have to process this file using regular file i/o functions
such as Open, Line Input #, etc., and then add each word to the table
using an Append query or a recordset.AddNew.

-Tom.

Hi, I have a set of comma delimited values in a text file. They import
fine. However, they are all in one record. How can I get each value
on one record? For example, say I have:

toys, books, shoes, houses

If I import, I get them all on one row.

I want each one on a separate row:

toys
books
shoes
houses

Any ideas?

Thanks for any help.


Mar 10 '06 #2
You can use File I/O as Tom suggests or you can import to a table and then
open a recordset on the imported table and run through the fields apending
the values to your target table then drop the imported table.

e.g. Where the imported text file is in table MyText the target table is
MyTarget the Target field is MyTargField

Using DAO
dim db as DAO.Database
dim rsSce as DAO.Recordset
dim rsTarg as DAO.recordset
dim fldSce as DAO.Field

set db = Currentdb

set rsSce = db.Openrecordset(SELECT * FROM MyText)
set rsTarg = db.Openrecordset(SELECT * FROM MyTarget)

with rsSce
Do Until .EOF
for each fldSce in .Fields
rsTarg.AddNew
rsTarg.Fields(MyTargField) = fldSce.Value & ""
rsTarg.UpDate
Next
.MoveNext
Loop
.Close
End With

rsTarg.Close

Set rsSce = Nothing
Set rsTarg = Nothing
Set db = Nothing

--

Terry Kreft
<ne***********@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hi, I have a set of comma delimited values in a text file. They import
fine. However, they are all in one record. How can I get each value
on one record? For example, say I have:

toys, books, shoes, houses

If I import, I get them all on one row.

I want each one on a separate row:

toys
books
shoes
houses

Any ideas?

Thanks for any help.

Mar 10 '06 #3

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

Similar topics

3
by: Canes_Rock | last post by:
The information posted at: ...
4
by: Josh | last post by:
Hi, I'm using System.Data.DataSet.ReadXml to convert some xml from a webservice to a DataSet. The xml looks like: <?xml version="1.0"...
2
by: Andrew Chanter | last post by:
I have a VBA function that returns a string including "vbcr" (VB Carriage Return) to seperate a list into multiple rows, eg Item1 & vbcr & Item2 & vbcr & Item3 This works as planned in the...
2
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost...
3
by: Dinsdale | last post by:
I have an xml file that is read into an object using serialization. One of the objects has a string field called delimeter that I want to contain a carriage return. Instead of trying to include the...
3
by: Someone | last post by:
Hello Using the c file io functions if reading a csv file there is a problem if a field contains an embedded carriage return. So I can check for apostrophe pairs but processing does seem a bit...
11
by: Someone | last post by:
Hello Using the c file io functions if reading a csv file there is a problem if a field contains an embedded carriage return. So I can check for apostrophe pairs but processing does seem a bit...
6
by: shajias | last post by:
Hi, I am having a xml code like this <name> I am having a carriage return here. Second line with carriage return. This is the last line. </name>
1
by: jollyroger | last post by:
I have searched the web forums, and can't seem to find an answer to this particular problem I have. In an excel sheet, cells in one column have formatted text in the "wrapped" cells. For many of...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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.