Thank you Bj. I'm going to use VB to see if I can get the info into the database. If this works (and you confirmed it should), then this will be a quarterly procedure, and will happen on my customer's desktop, not on the web. I'm going to go play with it now.
Diane -----Original Message----- From: Bj [mailto:[EMAIL PROTECTED] Sent: Friday, May 28, 2004 2:51 PM To: [EMAIL PROTECTED] Subject: [wdvltalk] Re: Huge file problem ----- Original Message ----- From: "Diane Schips" Subject: [wdvltalk] Huge file problem > I have .csv file that I need to import into a database. I can use either > Access or SQL. The problem, is the .csv file is 3 gigs... > ...Any ideas on how I can get to the data in the file? Easy answer: since you can open the csv file in your editor, edit it into smaller chunks and import them one at a time? More fun for programmers answer: In any cgi language - ASP, php, Perl - you can open a file for read access then read it line by line irrespective of how big the file might be. In php there is a 'fgetcsv()' function that reads one line from a csv file and puts it into an array: $rec = fgetcsv($file); $query = "INSERT INTO table (name, age, sex) " . "VALUES ('$rec[0]', '$rec[1]', '$rec[2]')"; In ASP you'd have to write a bit more code to separate the line at the comma separator. But basically it should be quite simple to write a one-shot script that opens the csv file, reads to end of file and inserts the data from each line into a db. ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email. To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% To unsubscribe via postal mail, please contact us at: Jupitermedia Corp. Attn: Discussion List Management 475 Park Avenue South New York, NY 10016 Please include the email address which you have been contacted with. ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email. To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] To unsubscribe via postal mail, please contact us at: Jupitermedia Corp. Attn: Discussion List Management 475 Park Avenue South New York, NY 10016 Please include the email address which you have been contacted with.
