Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

Filter .csv on import

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
b_lwalker@hotmail.com - 18 Mar 2007 23:32 GMT
Hi,

I've created an import specification that will import a .csv file into
a table.  It works just fine except that the program (our print
tracking software) that creates the .csv file will put the header
information in the first three rows, and the last three rows are
miscellaneous information too.

This generates an error tabble on import, even though the data I want
imports fine.

What I want to do is 'catch' the data on import, filter out the
useless stuff, then transfer it into the table.

Any ideas on how to do this in VB (or via a query)?
Allen Browne - 19 Mar 2007 01:46 GMT
There's a couple of approaches here.

One is to massage the file before import. If the import is rare, you might
do this by opening the csv in Notepad, and removing the offending lines
before import.

If importing is common, you could do that in VBA code. Open the file for
input, and another for output. Input each line, and Print the lines you want
to the output file. Then TransferText on the real file.

That's probably easier than importing it into a big flat table where all
fields are Text 255 with no validation, and then using an Append query to
write the valid records to your real table.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hi,
>
[quoted text clipped - 11 lines]
>
> Any ideas on how to do this in VB (or via a query)?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.