Re: Removing columns from a text file
| From: | Kenn Murrah | Date: | Thu, 27 Mar 2003 15:49:36 +0000 |
| Subject: | Re: Removing columns from a text file | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141244@lists.php.net to get a copy of this message | ||
could you just write a simple awk script to read each line and write out
only the columns you wish to keep?
----- Original Message -----
From: "CPT John W. Holmes" <holmes072000@charter.net>
To: "George Pitcher" <george.pitcher@ingenta.com>;
<php-general@lists.php.net>
Sent: Thursday, March 27, 2003 9:50 AM
Subject: Re: [PHP] Removing columns from a text file
> > 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...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>