is there any way to do this....(files)

This is a discussion on is there any way to do this....(files) within the C Programming forums, part of the General Programming Boards category; another question concerning files.... ok, i was wondering if there was any way that i would be able to skip ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    106

    is there any way to do this....(files)

    another question concerning files....
    ok, i was wondering if there was any way that i would be able to skip over certain parts in a file and not have them read into the program...example (this would be inside the .txt, .dat. .whatever file):

    name=blahblah

    i just want it to read in the "blahblah" part, but not the "name=" part. any way to do this? im guessing there is, i just havent come up with it yet. any help would be appreciated. thanks!

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,437
    Use fgets to read in the whole line
    Use strchr to locate the '=' char on that line

  3. #3
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    523
    or you could use a hash algorithm to creat unique a index for your data, which would allow you to know the position in the file where your data is stored. This is best suited to binary files though
    Last edited by C_Coder; 02-03-2002 at 09:02 AM.
    All spelling mistakes, syntatical errors and stupid comments are intentional.

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    ill take a look into the first response. the second suggestion seems a bit complicated: ) but thanks anyways for the help.
    later

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ressources files
    By mikahell in forum Windows Programming
    Replies: 4
    Last Post: 06-19-2006, 06:50 AM
  2. add source files to embedded VC 4.0
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 03:28 AM
  3. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  4. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 10:46 AM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21