how to read a value from txt-file and change it ?

Hello all ,
I want to do a simple thing -
I have a txt file with 1 line :
“the number is - 1”
now I want that every time I run script the sentence in the txt-file will change +1
"the number is - 2 "
I don’t know how to read only the value.

any help ?

Thanks ,

I have manage to read the file , but it won’t give me to add +1.

this is what I did:

:global num [/file get test.txt contents]
:environment print 
"num"="4
:set num ($num +1);
Script Error: cannot add string to time interval

can anyone help?

Thanks ,