Re: Removing columns from a text file

From: Date: Thu, 27 Mar 2003 15:50:01 +0000
Subject: Re: Removing columns from a text file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-141242@lists.php.net to get a copy of this message
> I have a text file file ready to go into a Filemaker database. It has over > 5000 rows, each containing over 500 columns. > > If I do a straight import I can only pull in the first 442 colums, but all > records. I can't take it in via Excel for the same reason - column limit > stops at 'IV' - never got that far before. > > Is there a way to remove columns from the file using php on a fgets() basis? > I can identify which columns I can do without quite easily - certainly > enough to pare the file down to a reasonable extent. You can't just "remove columns". You'd have to read in each line, chop off the end (however much you want), and re-write it to a separate file. The load the second file you just created into Filemaker. > An alternative would be to create a MySQL Table and drop columns there. You could probably use the LOAD DATA INFILE query to do this quickly. ---John Holmes...

« previous php.general (#141242) next »