From .txt file to .stro file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
sk8ordie
Posts: 13
Joined: 10 Feb 2021 03:56

From .txt file to .stro file

#1 Post by sk8ordie » 18 Jun 2021 14:03

Hello!
(sorry for my English I will try to explain as clearly as possible)

I would like to read numbers from a .txt file and then expand the .stro file with this "{enter}"
since JREPL is quite complex, is it possible to add {enter} after the numbers?
or could some other solution be found?
actually as long as i can run it from .bat i would be interested in any solution

reading time.txt file then
create this load.stro file

inside time.txt
3546

then the load.stro file should look like this
3546{enter}

since I would run it several times a day, is it possible to avoid repeating it?
3546{enter}
2231{enter}

I could only get so far:

Code: Select all

@echo off
docker run -it screenbreak/singlefile-dockerized http://kodi:kodi@192.168.1.10:8080 > log.html
xidel -s log.html -e "<div class='playing-time-current'>{inner-html()}</div>" > time.txt
jrepl ":" "" /f "time.txt" /o -

Thanks in advance for your ideas and help!

sk8ordie
Posts: 13
Joined: 10 Feb 2021 03:56

Re: [solved] From .txt file to .stro file

#2 Post by sk8ordie » 19 Jun 2021 01:34

I've made some progress so that I can create the load.stro file

Code: Select all

@echo off
docker run -it screenbreak/singlefile-dockerized http://kodi:kodi@192.168.1.10:8080 > log.html
xidel -s log.html -e "<div class='playing-time-current'>{inner-html()}</div>" > time.txt
start /B "" jrepl ":" "" /f "time.txt" /o -
type time.txt > load.stro
start /B "" jrepl ":" "" /f "load.stro" /o -
del /f log.html
del /f time.txt
exit

[solved]

Code: Select all

docker run -it screenbreak/singlefile-dockerized http://kodi:kodi@192.168.1.10:8080 > log.html
xidel -s log.html -e "<div class='playing-time-current'>{inner-html()}</div>" > time.txt
for /f "tokens=1,2,3 delims=:" %%G IN (time.txt) do (echo %%G%%H%%I{enter}) >load-pos.stro
del /f log.html
del /f time.txt
exit

Post Reply