-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55c609c
commit f7fef50
Showing
11 changed files
with
272 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Set CSV2HTML$Dir <Obey$Dir> | ||
<Obey$Dir>.SmartIcon <Obey$Dir>.!Sprites <Obey$Dir>.!Sprites4 <Obey$Dir>.!Sprites5 | ||
Set Alias$CSV2HTML <CSV2HTML$Dir>.!Run %%*0 | ||
Set File$Type_122 TSV | ||
Set File$Type_C7D SID | ||
Set File$Type_DFE CSV | ||
Set File$Type_FAF HTML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CSV2HTML v0.6 | ||
~~~~~~~~ | ||
CSV2HTML will take a CSV file and convert it to an HTML file | ||
|
||
Syntax: | ||
|
||
*csv2html <CSV file> [<HTML file>] | ||
|
||
If no HTML file is specified, it will create a file called HTMLOutput in the current directory. | ||
An example CSV file is included in the archive | ||
|
||
v0.2 now supports cells with multiple lines and outputs in a more human readable format. | ||
|
||
v0.3 supports blank lines in CSV files | ||
|
||
v0.4 supports TSV files (CSV files separated with tabs instead of commas) and SID files (CSV files terminated using CR-LF) | ||
|
||
v0.5 will use the Brandy BASIC interpreter if it can find it. This will allow CSV2HTML to cope with huge files. Brandy is available from http://jaguar.orpheusweb.co.uk/branpage.html | ||
|
||
v0.6 makes several minor changes. | ||
|
||
By Cameron Cawley |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Run <Obey$Dir>.!Boot | ||
If "%0"="" AND "<Wimp$State>"="desktop" THEN Filer_Run <CSV2HTML$Dir>.!Help | ||
If "%0"="" AND "<Wimp$State>"="commands" THEN Echo Syntax: *csv2html <60>CSV file<62> [<60>HTML file<62>] | ||
If "%0"="" THEN Obey | ||
Set CSV2HTML$File %0 | ||
If "%1"<>"" THEN Set CSV2HTML$Output %1 ELSE Set CSV2HTML$Output HTMLOutput | ||
<Obey$Dir>.ProgThere brandy | ||
If "<ProgThere$There>"="Yes" Then Brandy -quit <CSV2HTML$Dir>.!RunImage Else Run <CSV2HTML$Dir>.!RunImage | ||
Unset CSV2HTML$File | ||
Unset CSV2HTML$Output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
REM CSV2HTML | ||
REM By Cameron Cawley | ||
open%=0 | ||
SYS "OS_File",21,"<CSV2HTML$File>" TO FILE%,,,,,,TYPE% | ||
IF FILE% = 0 THEN SYS "OS_File",19,FNreadsysvar("CSV2HTML$File"),0 | ||
IF TYPE%=&122 THEN N$=CHR$(9) ELSE N$="," | ||
ON ERROR PROCerror | ||
FILE=OPENIN "<CSV2HTML$File>":open%=1 | ||
HTML=OPENOUT "<CSV2HTML$Output>":open%=2 | ||
BPUT#HTML, "<html><body>" | ||
BPUT#HTML, "<table border=""1"">" | ||
dqbefore%=0:swap%=0 | ||
REPEAT | ||
TEXT$=GET$#FILE | ||
FINAL$="" | ||
char%=1 | ||
doublequotes%=dqbefore% | ||
REPEAT | ||
IF MID$(TEXT$,char%,1) = N$ AND doublequotes% = 0 THEN | ||
FINAL$=FINAL$+"</td><td>" | ||
ELSE | ||
IF MID$(TEXT$,char%,1) = CHR$(34) THEN | ||
IF doublequotes% = 1 THEN | ||
doublequotes% = 0 | ||
ELSE | ||
doublequotes% = 1 | ||
ENDIF | ||
ELSE | ||
FINAL$=FINAL$+MID$(TEXT$,char%,1) | ||
ENDIF | ||
ENDIF | ||
char%=char%+1 | ||
UNTIL char% >= LEN(TEXT$)+1 | ||
IF doublequotes% = 1 THEN | ||
FINAL$=FINAL$+"<br>" | ||
ELSE | ||
FINAL$=FINAL$+"</td></tr>" | ||
ENDIF | ||
IF dqbefore% = 0 THEN FINAL$="<tr><td>"+FINAL$ | ||
IF swap%=0 THEN BPUT#HTML, FINAL$ | ||
IF doublequotes% = 1 THEN dqbefore%=1 ELSE dqbefore%=0 | ||
IF TYPE%=&C7D AND swap% = 0 THEN swap%=1 ELSE swap%=0 | ||
UNTIL EOF#FILE | ||
BPUT#HTML, "</table>" | ||
BPUT#HTML, "</body></html>" | ||
CLOSE#HTML:open% = 1 | ||
CLOSE#FILE:open% = 0 | ||
OSCLI "SetType <CSV2HTML$Output> &FAF" | ||
END | ||
|
||
DEF PROCerror | ||
ON ERROR OFF | ||
IF open% = 2 THEN CLOSE#HTML | ||
IF open% > 0 THEN CLOSE#FILE | ||
PRINT REPORT$+" at line "+STR$(ERL) | ||
END | ||
ENDPROC | ||
|
||
DEF FNreadsysvar(variable$) | ||
DIMvar%1024 | ||
SYS "XOS_ReadVarVal",variable$,var%,1024,0 TO ,,A% | ||
var%?A%=13 | ||
=$var% |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
SYS "OS_File",21,"Run:"+FNargs(1) TO FILE% | ||
IF FILE%=0 AND FNreadsysvar("Alias$"+FNargs(1))="" THEN | ||
*Set ProgThere$There No | ||
ELSE | ||
*Set ProgThere$There Yes | ||
ENDIF | ||
END | ||
|
||
DEF FNargs(number%) | ||
SYS "OS_GetEnv" TO Env$ | ||
char%=0 | ||
space%=0 | ||
REPEAT | ||
char%+=1 | ||
IF MID$(Env$,char%,1)=" " THEN | ||
space%+=1 | ||
ENDIF | ||
UNTIL space% = 3 OR char% = LEN(Env$) | ||
A$=RIGHT$(Env$,LEN(Env$)-char%) | ||
IF number%=0 THEN | ||
FINAL$=A$ | ||
ELSE | ||
char%=0 | ||
space%=0 | ||
start%=-1 | ||
REPEAT | ||
char%+=1 | ||
IF space%=number%-1 AND start%=-1 THEN | ||
start%=char% | ||
ENDIF | ||
IF MID$(A$,char%,1)=" " THEN | ||
space%+=1 | ||
ENDIF | ||
UNTIL space% = number% OR char% > LEN(A$) | ||
FINAL$=MID$(A$,start%,char%-start%) | ||
ENDIF | ||
=FINAL$ | ||
|
||
|
||
DEF FNreadsysvar(variable$) | ||
DIMvar%1024 | ||
SYS "XOS_ReadVarVal",variable$,var%,1024,0 TO ,,A% | ||
var%?A%=13 | ||
=$var% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
REM SmartIcon | ||
REM By Cameron Cawley | ||
ON ERROR PROCerror | ||
IF FNargs(3)="" THEN | ||
PRINT "Syntax: SmartIcon <RO3 icons> <RO4 icons> <RO5 icons>" | ||
END | ||
ENDIF | ||
IF LEFT$(FNargs(0),6)="- - - " OR FNargs(0)="- - -" THEN | ||
PRINT "At least one icon set must be provided." | ||
END | ||
ENDIF | ||
THEME$=FNreadsysvar("Wimp$IconTheme") | ||
RISCOS3$="" | ||
RISCOS4$="" | ||
RISCOS5$="" | ||
IF FNargs(1)<>"-" THEN | ||
RISCOS3$=FNargs(1) | ||
ENDIF | ||
IF FNargs(2)<>"-" THEN | ||
RISCOS4$=FNargs(2) | ||
ENDIF | ||
IF FNargs(3)<>"-" THEN | ||
RISCOS5$=FNargs(3) | ||
ENDIF | ||
IF RISCOS3$="" THEN | ||
IF RISCOS4$="" THEN | ||
RISCOS3$=RISCOS5$ | ||
ELSE | ||
RISCOS3$=RISCOS4$ | ||
ENDIF | ||
ENDIF | ||
IF RISCOS4$="" THEN | ||
IF RISCOS3$="" THEN | ||
RISCOS4$=RISCOS5$ | ||
ELSE | ||
RISCOS4$=RISCOS3$ | ||
ENDIF | ||
ENDIF | ||
IF RISCOS5$="" THEN | ||
RISCOS5$=RISCOS4$ | ||
ENDIF | ||
*Set SmartIcon$OSVer 6 | ||
*RMEnsure UtilityModule 6.00 Set SmartIcon$OSVer 5 | ||
*RMEnsure UtilityModule 5.00 Set SmartIcon$OSVer 4 | ||
*RMEnsure UtilityModule 3.80 Set SmartIcon$OSVer 3 | ||
OSVER$=FNreadsysvar("SmartIcon$OSVer") | ||
IF OSVER$="3" THEN | ||
OSCLI "IconSprites "+RISCOS3$ | ||
ENDIF | ||
IF OSVER$="4" OR OSVER$="6" THEN | ||
OSCLI "IconSprites "+RISCOS4$ | ||
ENDIF | ||
IF OSVER$="5" THEN | ||
IF FNlowercase(THEME$)="morris4." THEN | ||
OSCLI "IconSprites "+RISCOS3$ | ||
ELSE | ||
IF FNlowercase(THEME$)="ursula." THEN | ||
OSCLI "IconSprites "+RISCOS4$ | ||
ELSE | ||
OSCLI "IconSprites "+RISCOS5$ | ||
ENDIF | ||
ENDIF | ||
ENDIF | ||
END | ||
|
||
DEF PROCerror | ||
REPORT | ||
PRINT " at line "+STR$(ERL) | ||
END | ||
ENDPROC | ||
|
||
DEF FNargs(number%) | ||
SYS "OS_GetEnv" TO Env$ | ||
char%=0 | ||
space%=0 | ||
REPEAT | ||
char%+=1 | ||
IF MID$(Env$,char%,1)=" " THEN | ||
space%+=1 | ||
ENDIF | ||
UNTIL space% = 3 OR char% = LEN(Env$) | ||
A$=RIGHT$(Env$,LEN(Env$)-char%) | ||
IF number%=0 THEN | ||
FINAL$=A$ | ||
ELSE | ||
char%=0 | ||
space%=0 | ||
start%=-1 | ||
REPEAT | ||
char%+=1 | ||
IF space%=number%-1 AND start%=-1 THEN | ||
start%=char% | ||
ENDIF | ||
IF MID$(A$,char%,1)=" " THEN | ||
space%+=1 | ||
ENDIF | ||
UNTIL space% = number% OR char% > LEN(A$) | ||
FINAL$=MID$(A$,start%,char%-start%) | ||
ENDIF | ||
=FINAL$ | ||
|
||
|
||
DEF FNreadsysvar(variable$) | ||
DIMvar%1024 | ||
SYS "XOS_ReadVarVal",variable$,var%,1024,0 TO ,,A% | ||
var%?A%=13 | ||
=$var% | ||
|
||
DEF FNlowercase(string$) | ||
ascii%=0 | ||
lowercase$="" | ||
FOR A = 1 TO LEN(string$) | ||
ascii%=ASC(MID$(string$,A,1)) | ||
IF ascii% > 64 AND ascii% < 91 THEN | ||
ascii%=ascii%+32 | ||
ENDIF | ||
lowercase$=lowercase$+CHR$(ascii%) | ||
NEXT | ||
=lowercase$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"Orange",0.2 | ||
"Apple",0.3 | ||
"Pear",0.1 | ||
"Coke",0.4 | ||
"Pizza",0.9 | ||
"Banana",0.25 | ||
"Pineapple",0.38 |