Monday, 15 August 2011

c++ - handling files having same name (series of files) -


I'm a bit new to handling files. So a little bit is being confused with the following thing because I do not know how it will be.

My two series are text files (I think, file format will not be a problem). For example I can say my_1.txt, my_2.txt, ..., my_50.txt and your_1.txt, your_2.txt .... your_60.txt

All these files are in my work folder, where my C ++ project makes executable.

Now, I want to read these two data series and want to create two separate vectors.

How can the files be read to avoid any of the wrong names and names, as if I have many names (similar formats) (without getting support from different names)?

Actually, I'm looking at some starting points and will it be a good option to continue?

To promote, you can read all the directory contents.

  typed vector & lt; Path & gt; Vec; // Store Path, VCC V // so we can copy them later (directory_iterator (p), directory_iterator (), back_inserter (v));   

Use Linux for a library, its use is not available on linux dirent.h is the POSIX header. On Windows you use the Find * File * () function in the Win32 API.

No comments:

Post a Comment