File Handling

Hi All, I want to search the content of a file for a specific word and write the resulted list in another file.
For example ABC.txt contains file names with extensions. Now I want a list of .exe files and write it down in another file say result_exe.txt file.

Any pointers, suggestions will be appreciated.

Thanks in advanceā€¦!
how are the file names spereated from each other? by tokens or just one name in each single line?...

u could read the single characters and check for the seperator or the end of the line or use something like getline , etc...

maybe u can add the strings you read out to an array and then use the string-libraby functions to check for ".exe" being part of the hole string at the end of it...

the rest is yours :P...
Actually, this file has other information as well(in which i am not interested)...
the separator is space.

Reading sigle line will be a bit slow i guess,as the file size is large so i will go for the getline function.

Thanks... :)

Topic archived. No new replies allowed.