Hello,
I'm writing a program that parses out data contained in one large text
file, each page separated by a control char. I explode() the data by the
control char into an array, then I'm inserting them in MySQL by a client
number and a page number. As of now, I've just been counting down
characters by substr ($page, startchar, length to grab) and it seems to
work for most of the pages.
The problem is that it the data I index by does not always occur the same
number of characters down the $page variable. I.e., the name line2 on the
right is not always filled out or is a different length:
-=-=-=-
yada yada yada yada yada yada name line 1
blankline name line 2
blankline
blankline
my name client number page no
my address
my address
my city my state my zip
and so forth...
-=-=-=-
I'd like to be able to do something more like this:
in $page, on line 5 chars 40-95 is $indexme
I tried explode()ing the $page by "\n" and it wouldn't work.
Any suggestions?
Thanks in advance.
-shad
"You are old," said the youth, "as I mentioned before,
And make errors few people could bear;
You complain about everyone's English but yours --
Do you really think this is quite fair?"
"I make lots of mistakes," Father William declared,
"But my stature these days is so great
That no critic can hurt me -- I've got them all scared,
And to stop me it's now far too late."
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php