Strings - Search a string pattern from a file & write to new file with formatted

Hi All,


I am still new to C++ & I have this question & I hope I can find an answer here.

I have the below in a file (captured from a directory list to a file). Now I want to search for Test_*.txt & get the output a new file with the below format.

Any help/idea on this is much appriciated.


File-1 (current contents)

...read-all-files.cca.outTest_ABCDEF1.txtTest_ABCDEF2.txtTest_HGHJJ29.txtTest_dfedd4.txtTest_fgtty6.txtread-all-files-1.ccread-all-files-2.ccread-all-files-3.ccread-all-files-to-file-1.ccread-all-files-4.cctest1w-list.txt...read-all-files.cca.outTest_gghhh5.txtTest_jjjjk7.txtTest_KJKKL7.txtTest_hjggh9.txtTest_hjsss3.txtread-all-files-1.ccread-all-files-2.ccread-all-files-3.ccread-all-files-to-file-1.ccread-all-files-4.cctest1w-list.txt...read-all-files.cca.outTest_hghjj5.txtTest_hhggg4.txtTest_ASDDD5.txtTest_DDDDDEE3.txtTest_Hkkkkr5.txtread-all-files-1.ccread-all-files-2.ccread-all-files-3.ccread-all-files-to-file-1.ccread-all-files-4.cctest1w-list.txtCE-LIST-file-1.ccread-all-files-5.cc


File-2 (required contents)

Test_ABCDEF1.txt
Test_ABCDEF2.txt
Test_HGHJJ29.txt
Test_dfedd4.txt
Test_fgtty6.txt
Test_gghhh5.txt
Test_jjjjk7.txt
Test_KJKKL7.txt
Test_hjggh9.txt
Test_hjsss3.txt
Test_hghjj5.txt
Test_hhggg4.txt
Test_ASDDD5.txt
Test_DDDDDEE3.txt
Test_Hkkkkr5.txt


Mathew
Topic archived. No new replies allowed.