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

Reading a .csv file with no headings

Status
Not open for further replies.

Premalm

Programmer
Mar 20, 2002
164
US
Hi Guys,

How do I read a .csv file and put it in a recordset
which has no column headings ?

Thanks
Premal
 
Use TransferText as in: [blue]
DoCmd.TransferText acImportDelim, , "Table_Name", "temp.csv", False [/blue]
Simon Rouse
 
In order for you command to work I will have to call
this statement from Access. But I am using VBA from Excel.
how do I use this through excel ?

Thanks
Premal
 
I usually import csv as a csv file and if neccesary in a macro. From there it depends on the data but usually a mix of cell formulae and VBA.

If you think a bit harder you can always read in the file byte by byte and parse at that point.

viz OPEN and GET

My website has many subpages produced by writing-out as a file from Excel - and giving it a .HTM extension. This includes reading-in fixed blocks from a header file, byte by byte. - if you look in dance diary you will see one of the programs to dounload. It is not the most recent version. The VBA may give you ideas but there are not that many comments.
 
reading-in the csv file produces a new workbook which has to be copied as a page (or block) and paste into the place you want it. Works a treat for me. not pure and clean but functional and fully workable manually - hence record a macro and then tinker. Oh- and the file type has to be specified in "open dialog".

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top