J
JR
I am trying to figure out the code to read in the structure of a text
file to parse it. The way it works is the first block is the layout,
then the rest has the data so:
--- start text file ---
firstname
lastname
address1
address2
city
state
~~~~~~
firstname=joe
lastname=riley
address1=444 east park lane
address2=NULL
city=Amadam
state=Ohio
~~~~~~
firstname=pete
lastname=johnson
address1=101 east park lane
address2=NULL
city=Aratmas
state=Georgia
--- end text file ---
If someone could help provide me some sample code that could read in
the first block, and store the count and "column" names in an array or
other means, then parse the rest and output them to the screen that
would be good. I have some manipulation I need to do with the data,
but this would put me in the right direction.
Thanks for any help someone could provide.
JR
file to parse it. The way it works is the first block is the layout,
then the rest has the data so:
--- start text file ---
firstname
lastname
address1
address2
city
state
~~~~~~
firstname=joe
lastname=riley
address1=444 east park lane
address2=NULL
city=Amadam
state=Ohio
~~~~~~
firstname=pete
lastname=johnson
address1=101 east park lane
address2=NULL
city=Aratmas
state=Georgia
--- end text file ---
If someone could help provide me some sample code that could read in
the first block, and store the count and "column" names in an array or
other means, then parse the rest and output them to the screen that
would be good. I have some manipulation I need to do with the data,
but this would put me in the right direction.
Thanks for any help someone could provide.
JR