Re: [PHP] Delete first line of a csv file if it is the headers

2007-05-02 Thread Richard Lynch
Do one, and only one, fgetcsv() before you entere the loop? Or, if only SOME people add the header lines to their CSV file, check if one of the numeric fields is actually numeric, and skip any "bad" lines. You could even keep a counter going of which line you are on, and give an error message if

Re: [PHP] Delete first line of a csv file if it is the headers

2007-04-29 Thread Chris
Richard Kurth wrote: The below script will parse a csv file to a database I need to remove the first line because it is the header files and I don't need them. How can I test for that and remove them. $file = fopen($_POST['copy'], 'r') or $message .= "Could not open" . $_POST[copy] . "fo

[PHP] Delete first line of a csv file if it is the headers

2007-04-29 Thread Richard Kurth
The below script will parse a csv file to a database I need to remove the first line because it is the header files and I don't need them. How can I test for that and remove them. $file = fopen($_POST['copy'], 'r') or $message .= "Could not open" . $_POST[copy] . "for reading.\n";