Background for Skyrim SE
Member of the DbMiscFunctions script
string[]functionGetAllStringsFromFile(stringFileContents="", stringFilePath="", stringRangeStart="", stringRangeEnd="", stringStartKey="", stringEndKey="", string[]Default=NONE)Global

Description

Documentation Comment

Save All strings in the StartKey and Endkey brackets, between the RangeStart and RangeEnd strings from the FileContents or FilePath to a string array.
Example: you have a file Data/interface/MyStrings.txt that contains:
MyStringA = [My String A]
MyStringB = [My String B]

String[] MyStrings = GetAllStringsFromFile("Data/interface/MyStrings.txt")
MyStrings[0] will equal "My String A" and MyStrings[1] will equal "My String B"

to specify a range to search you can do this:

File contains:

StringsA
MyStringA = [My String A]
MyStringB = [My String B]
StringsAEnd
MyStringC = [My String C]

Using String[] MyStrings = GetAllStringsFromFile(FilePath = "Data/interface/MyStrings.txt", "StringsA", "StringsAEnd")
Only My String A and My String B are saved to the array.

If RangeStart is "", starts search at the beginning of the file. If RangeEnd is "", stops searching at the end of the file.

requires SKSE and PapyrusUtil


Parameters

  1. stringFileContents=""

  2. stringFilePath=""

  3. stringRangeStart=""

  4. stringRangeEnd=""

  5. stringStartKey=""

  6. stringEndKey=""

  7. string[]Default=NONE


Examples

Auto-Generated Example

string myString__FileContents
string myString__FilePath
string myString__RangeStart
string myString__RangeEnd
string myString__StartKey
string myString__EndKey
string[] myStringArray__Default

string[] returnedValue = DbMiscFunctions.GetAllStringsFromFile(myString__FileContents, myString__FilePath, myString__RangeStart, myString__RangeEnd, myString__StartKey, myString__EndKey, myStringArray__Default)
Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.