summaryrefslogtreecommitdiff
path: root/support/csvtolatex/Source/configcreator-ctl.vbs
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/csvtolatex/Source/configcreator-ctl.vbs
Initial commit
Diffstat (limited to 'support/csvtolatex/Source/configcreator-ctl.vbs')
-rw-r--r--support/csvtolatex/Source/configcreator-ctl.vbs75
1 files changed, 75 insertions, 0 deletions
diff --git a/support/csvtolatex/Source/configcreator-ctl.vbs b/support/csvtolatex/Source/configcreator-ctl.vbs
new file mode 100644
index 0000000000..4a33e122ac
--- /dev/null
+++ b/support/csvtolatex/Source/configcreator-ctl.vbs
@@ -0,0 +1,75 @@
+Option Explicit
+
+'J:\Eigene Dateien\Dokumente\Hannes\Visual Basic\csvtolatex\config.ctl
+'Test.csv
+'\LaTeXTest
+
+Const version = "1.2"
+
+Dim sPath, input, output, mode, title, msg, ende, options, comma
+title = "csvtolatex configuration creator " & version
+ende = True
+
+sPath = InputBox("Please write here the full path and the name with extension of the configuration-file. Example: 'C:\user\documents\LaTeX\config.ctl'", title)
+
+If InStr(sPath, ":\") Then
+ If InStr(Right(sPath, 4), ".ctl") Then
+
+ Else
+ sPath = sPath + ".ctl"
+ End If
+Else
+ ende = False
+End If
+
+
+input = InputBox("Please write here the name of the inputfile with extension like written in the documentation. Example: '\csv-tables\input.csv'", title)
+
+If StrComp(input, "") Then
+Else
+ ende = False
+End If
+
+If ende Then
+ output = InputBox("Please write here the relative or absolute Path for the outputfiles. Example: '\LaTeX-tables\' If you want the path relative to your configuration file write 'config=' before the path. Example: 'config=\LaTeX-tables\'", title)
+
+
+ mode = InputBox("Please write here weather 'text' for textmode or 'math' or nothing for mathmode", title)
+
+ If InStr(mode, "nothing") Then
+ mode = ""
+ msg = MsgBox("If you wanted mathmode by writing 'nothing' I have set it to blank, because nothing is no reserved word", 0, title)
+ End If
+
+
+ Dim Fso, sFile
+
+ Set Fso = CreateObject("Scripting.FileSystemObject")
+ Set sFile = Fso.CreateTextFile(sPath)
+
+ sFile.WriteLine "input=" & input
+ If StrComp(output, "") Then
+ output = "output=" & output
+ sFile.WriteLine output
+ End If
+ If StrComp(mode, "") Then
+ mode = "mode=" & mode
+ sFile.WriteLine mode
+ End If
+
+ options = InputBox("Please write here the option you choose. Example: 'nolines' to have no \hline at the end of the lines", title)
+
+ If StrComp(options, "") Then
+ options = "options=" & options
+ sFile.WriteLine options
+ End If
+
+ sFile.WriteLine InputBox("If you wish write here the comma/point replacement you want, if you do not want to replace it, just leave it out. Write >commatopoint< if you want to convert all commas to points, or >pointtocomma> if you want to have it the other way around", title)
+
+
+ sFile.Close
+
+ msg = MsgBox("I have written in: >" & sPath & "< input: >" & input & "< output: >" & output & "< and mode: >" & mode & "< I hope this is all right.", 0 , title)
+Else
+ msg = MsgBox("There has to be a correct configurationfilename with absolute path and at least a correct inputfilename. Your configurationfilepath and -name was: >" & sPath & "< And your inputfile was: >" & input & "<", 0, title)
+End If \ No newline at end of file