I have the following configuration file that I want to use from Scala applying this library:
P11 {
yes="0.0"
no="1.0"
}
P12 {
yes="0.01"
no="0.99"
}
P13 {
id = "123 567 \
T 0: \
If (f 23 <= 0.0)"
}
This is how I do it:
import com.typesafe.config.ConfigFactory
val configFileName = "/usr/develop/tests/config.conf"
val parsedConfigMCF = ConfigFactory.parseFile(new File(configFileName))
val confMCF = ConfigFactory.load(parsedConfigMCF)
Then I get the error:
Expecting a value but got wrong token: 'newline' (backslash followed by 'newline', this is not a valid escape sequence
It looks like it does not like \
(backslash), but I need to put several lines for id
in P13
.
From official documentation of Typesafe Config:
multi-line strings with triple quotes as in Python or Scala
so:
P13 {
id = """123 567
T 0:
If (f 23 <= 0.0)"""
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With