I'm sure people will flame me for this, so wait
while I put on my

<suit="flame proof">
You can use strtok(), but even the man page
tells you not to.  It all depends on how robust
you want your functionality to be and what kind of
features you wish to implement.  I use it
successfully in on of my programs right now.

Read a line from the file, strtok the results
using ':' as a separator, and you're all set.
</suit>

There are better options, but if you want something
quick and dirty, without having to get into text
parsing, this will work.

~Patrick

> ----------
> From:         [EMAIL PROTECTED][SMTP:[EMAIL PROTECTED]]
> Reply To:     [EMAIL PROTECTED]
> Sent:         Monday, May 11, 1998 5:05 PM
> To:   [EMAIL PROTECTED]
> Subject:      How does one manage files with separators?
> 
> 
> 
> Hi,
>       I'm working on a little project, and I
>       got stuck on a problem.  So far, I
>       already have interface, and the rest
>       created, now, all I need, is a way to
>       retrieve information from a file.
>       
>       A file will consist of 
>       
>       <Field name>:<Value>
>       <Field name>:<Value>
>       
>       the ":" in the middle is the separator,
>       and <Value> can be either numbers or
>       characters.
>       I can figure it out, how to store the
>       both variables once retrieved ( I plan on
>       using struct ), all I need a sample on
>       how to read the file, and retrieve both
>       <Field> and <Value>
> 
>       Any advise?
> 
> Thank you very much,
> Nikita.
> 
> P.s.  Does anybody know of a program I can
> use as an example ( with source, of course ).
> 

Reply via email to