Error while reading csv file

hello,
i like to read this csv file

alarm,test
1,0

here is my rule

rule "5min"
    when
        Time cron "0 0/1 * * * ?"
    then
        val setpoint = executeCommandLine("cat openhab.config", 1000).split(",").get(1)
        logInfo("5min  is", setpoint.toString())

       
end

with get(1) I get

test
1

how do I get the “1” alone???

Thanks

solved by

executeCommandLine("cat openhab.config", 1000).split("\n").get(1).split(",").get(0)
1 Like

can somebody help me with this error??

var string_localsusvbatterycapacity =  executeCommandLine("/bin/sh@@-c@@(sed -ne 's/.*capacity.* \([0-9.][0-9.]*\)%.*/\1/p' /etc/openhab2/services/susv.status)", 5000)

error

 Configuration model 'system.rules' has errors, therefore ignoring it: [12,100]: Invalid escape sequence (valid ones are  \b  \t  \n  \f  \r  \"  \'  \\ )