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" <[EMAIL PROTECTED]>
To: "George Pitcher" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
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
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to