I can read my file, but cannot write in it, with every value per line... >>> Thanks to your help...
import strutils
let cont = readFile("values.txt")
let val = cont.splitLines()
echo val
echo "val1: ", val[0], " val2: ", val[1], " val3: ", val[2]
var val1 = readLine(stdin) # I put 5555
var val2 = readLine(stdin) # I put 6666
var val3 = readLine(stdin) # I put 7777
var contW = open("values.txt", fmWrite)
contW.writeLine(new1, new2, new3) # Don't work ! ! !
contW.close()
https://nim-lang.org/docs/streams.html#writeLine%2CStream%2Cvarargs%5Bstring%2C%5D
"Writes one or more strings to the the stream s followed by a new line. No length field or terminating zero is written."
The newLine is added at the end, so you should do:
contW.writeLine(new1)
contW.writeLine(new2)
contW.writeLine(new3)