Hello All --

I have a csv file that I need to parse into a table.  Getting the
file open and into stuffed into an array is not really a problem, but
I want PHP to adapt the table structure to the data on the fly.  For
example, some data (from the hgitner.com stamp buying list):

26,used,3 Washington Dull Red type II,$1.00 ,-,-
"Fine + OG Hinged 232-40, 285-90, 294-99, 323-7 wanted. Call or ship!",,,,,
534A,single,"2 Washington, type VI (imperf, offset)",$20.00 ,$12.00 ,$6.00
534B,single,"2 Washington, type Va (imperf, offset)",Needed Urgently!,,

I can easily get line 1 and 3 can easily into:

<td>26</td><td>3 Washington Dull Red type

but line 2 and 4 are my problem.  I want PHP to take line 2 and see
that there is only one cell of data in the  and four blanks in the
array and thus create:

<td colspan=5>Fine + OG Hinged 232-40, 285-90, 294-99, 323-7 wanted.
Call or ship!</td>

PHP should see that line 4 ends in two blanks and thus should output:

<td>34B</td><td>single </td><td>2 Washington, type Va (imperf,
offset) </td><td colspan=3>Needed Urgently!"

but I'm having some real trouble figuring out the logic/control
structures to do this.  If there is a class out there that does this,
I'd be happy to hear of it.  But I suspect my inexperience is the
real problem: I'm really hoping that someone can explain the logic of
how this might be done.

thanks in advance.


Peter Torraca

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to