I have a txt file that has a lot of content and in this file there is a lot of "include" word and I want to get data from all three lines after that.
myFile.txt: "-include:
-6.5 6.5
sin(x^2)
diff
-include
-5 5
cos(x^4)
diff"
How do I get this data in an array?
Based on your example (first include has
:at the end, second one doesn't) you could use something like this.Which results in the following output:
You can tune the loop to suit your needs. If you just want line numbers, use
includeStartandincludeEndvariables.