Deutsch | English

FilesFromCSV

With this simple Template Engine FilesFromCSV (Freeware) you can create text files like HTML from CSV records.

To do this you have to create a template with some placeholders in it. Each of the CSV records responds into one new file. The name of the file will be either the actual field or the index, if you don't provide the name of the field.

 

CSV sample  (input.csv):

tag ;description ;min ;max ;unit

PI001

;pressure tank 1 ;0 ;1000 ;kPa
LI001 ;level tank  ;0 ;100 ;%
TI001 ;temperature tank 1 ;0 ;150 ;°C

PI002

;pressure tank 2 ;0 ;1500 ;kPa

 

tamplate examle (template.txt):

Loopdescription:

Loop: %tag%

Description: %description%

Range: %min%-%max% %unit%

here is the sample as HTML (template.html):

<html><head><title>%tag%</title></head>

<body>

<h1>Loop: %tag%</h1>

<p><b>Description:</b> %description%</p>

<p><b>Range:</b> %min%-%max% %unit%</p>

</body>

 

For the sample above you can write this into your consolewindow.

FilesFromCSV.exe -HDR=YES -D=; -csv=C: emp\input.csv -template=C: emp emplate.html -filenamefield=tag -outpath=C: emp\output\

As a result you will find the following files on C: emp\output\ :

LI001.html

PI001.html

PI002.html

TI001.html

Why do i need it?:

  • As an Instrumentation Engineer for example, may be you have designed 1000 Instruments for your customer. If you want to create documentation for it, you can use your data from excel sheet to create it from.