here's a batch file i wrote to look up the current program details from sqlite3.exe so i could pipe it into my lcd..
all that is needed is sqlite3.exe and your database location..
[edit batch file accordingly] can be modified to get any info in the db! very fast too..
Boy,i wish someone would have helped me find these silly connect strings..
so i share them here with hope others would find it usefull..
enjoy!
[use: "whatever.bat channel"]
it just outputs to console, but add a ">filename.txt " at end of second sqlite command and it will write that file with info...
all that is needed is sqlite3.exe and your database location..
[edit batch file accordingly] can be modified to get any info in the db! very fast too..
Boy,i wish someone would have helped me find these silly connect strings..
so i share them here with hope others would find it usefull..
enjoy!
[use: "whatever.bat channel"]
Code:
@echo off
set ch=
rem **convert real channel# to oid channel# [internal ch# scheme]
for /f "usebackq tokens=1,2 delims=, " %%v in (`sqlite3 -separator "," "C:\Program Files\DEVNZ\Gbpvr\GBPVR.DB3" " SELECT oid FROM CHANNEL where channel_number=%1; " `) do @set ch=%%v
rem calculate and reorder current date
for /f "usebackq tokens=1,2,3,4 delims=/ " %%a in (`date /t`) do (@set nowdate=%%d-%%b-%%c)
rem convert pm 12hr time to 24hr time
for /f "usebackq tokens=1,2,3,4 delims=: " %%f in (`time /t`) do call :24hr %%h %%f
rem calculate time and concactenate date and time together
for /f "usebackq tokens=1,2,3,4 delims=: " %%p in (`time /t`) do (@set now='%nowdate% %hr1%:%%q:55.0000000')
rem run sqlite with the parameters we built
sqlite3 -separator ": " "C:\Program Files\DEVNZ\Gbpvr\GBPVR.DB3" " SELECT name, sub_title, description FROM PROGRAMME where start_Time < %now% and end_time > %now% and channel_oid = '%ch%' ; "
rem function to convert time format
:24hr
if "%1"=="PM" (set /a hr1=%2+12) else (set hr1=%2)
goto :eof
it just outputs to console, but add a ">filename.txt " at end of second sqlite command and it will write that file with info...
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie