trying to make a script to go thru multiple files and pull out #'s

ok i have a folder with many files with different names and am trying to figure out how to make a c++ script to go through them all and pull out some numbers from each file.

I know how to read from a specific file: inputfile.open("filename"); and all that but how can I make something that goes through a ton of files with all kinds of different names?

The format of the contents of the files are just text and I have to gather some numbers from each file, so how could I do that? Again I know how to get info from a file if the file only contains data I want to get, but I dont know how to ignore a bunch of data and pull out a few numbers that are located on several lines down and over from the beginning of the file.

any input is appreciated
Last edited on
Is there any reason not to use find & sed?

If there is, read the directory content (recursively?) and loop over the entries. Then you have to read each file until you have the info you want, and continue with the next file.
Topic archived. No new replies allowed.