Component/Function to search in a TXT-File?


#1

Hi at all. I’m new to C++ and Juce. Can anyone tell me please how to search after words in a Text-File ? For example :
In my File called “myFile.TXT” are special Tags like “[General]” or “[Randomizers]” and i want to read all the stuff, what`s between this Tags. Excuse for my bad English :wink: , I’m from Germany. But I hope you understand, what I mean.


#2

It’ll depend on the exact format of the file, but this should get you started

File f(T("myFile.txt"));
String s = f.loadFileAsString();

String s1 = s.fromFirstOccuranceOf(T("[General]"), false, false).upToFirstOccuranceOf(T("["), false, false);

#3

Thanks for the very fast reply. I try it out.


#4