Im currently writting a small database program for school, and im having a lot of trouble manipulating data within the file. My program has to write to a file in the following manner

[Record #] Moviename,year,length,reference#

and that has been no problem

but now i need it to scan the file for a specific record number (all record numbers are written as [Record #00] etc), and i have no idea how to do it. Also, you have to be able to edit the information in the file, and i have no idea how to do that

can someone give me a website or some personal information on inter-file manipulation?

01-23-2002

starX

Ouch, I've been working on a VERY similar problem for the past couple weeks. My resolution was ultimately to use perl, but that's probably not going to work in your situation. I spent quite a bit of time reading through the regex.h header file, and the files associated with it. In my situation, the idea was a file with lines that looked like:

A:1:somefile:75:3

and I needed all of those in a seperate variable. The idea was to grab any number of chars up until the colon, and than between colons five times over. It seems to me that you want a similar approach, I just can't tell you how exactly to do it in C.

As far as writing to the file goes, fputs should work well. The syntax is:

fputs(pointer_to_string, FILE *stream);

I hope that I've been of some assistance. Please, do keep me posted as to how this progresses.