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

Ignoring comment lines when importing text file 1

Status
Not open for further replies.

dgilbert

Programmer
Jun 26, 2002
6
US
Hi,

I'm importing data from a text file which has 4 fields of type "text", "number", "number", "number".

I can easily import this data without any problem using an import specification.

However, I would like to be able to IGNORE any blank lines or lines which begin with a special comment character (in my case a '#'). Up until now I've had to strip out any comment/blank lines manually before performing the import.

Any thoughts or suggestions?

Thanks in advance for any help!

-- Dan
 
Easiest way would be to write a DELETE query and run it after you load your data. You may want to create a separate table to initially load your data into, clean it up and then load it into your main table. Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Terry,

Thanks for the response. DUH! Your suggestion makes perfect sense! I was already importing into a temp table anyways, so implementing a delete query should be a piece of cake.

Thanks,

-- Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top