[ale] Stupid C Question

Chris Fowler ChrisF at computone.com
Wed Mar 21 17:34:45 EST 2001





In a tight environment, I can't use any of those.


I have looked at man pages of strtok.   It has fullfilled my needs.



-----Original Message-----
From: Bash, Richard M. [mailto:bash.r at ems-t.com]
To: ale at ale.org
Sent: Wednesday, March 21, 2001 5:18 PM
To: Chris Fowler
Subject: RE: [ale] Stupid C Question



Chris,
 
Just a suggestion, take it if you like:  Use a scripting language like Ruby, Python, or Perl to do this.  Several lines of code and you would be done.  I say this as a longtime user of C/C++.

 
Good luck!
Richard    
-----Original Message-----
From: Chris Fowler [mailto:ChrisF at computone.com]
To: ale at ale.org
Sent: Wednesday, March 21, 2001 4:51 PM
To: 'ale at ale.org'
Subject: [ale] Stupid C Question



I have a file that looks like this 




DATA:DATA:DATA 
DATA:DATA:DATA 
Each line is a new record and the DATA of each one can be of variable length.  I have tried to read the whole file in buffer and use sscanf to parse but that seems to yield no results.  I want to place each piece of DATA into character arrays.  The number of records in the file could be variable as well.  Any help on this would be greatly appreciate.  If you could point me to good documentation on reading, writing, parsing, and changing of disks files using C, I would appreciate that to.  I have many books on C but non really explain how to work with files.  Most of my files are config files that I am trying to create an interface to change them.

Thanks, 
Chris 







More information about the Ale mailing list