Catalog · How the catalog works
txt2inc
Shell program to convert any text file content as Pascal quoted string variable
- ★ 2 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
txt2inc
Shell program to convert any text file content as Pascal quoted string variable
Requirement
- FreePascal >= 3.0
Compilation
Clone this repository and run FreePascal compiler.
$ fpc txt2inc.pasRun
$ ./txt2inc /path/to/input/text/file /path/to/output/file variableNameFor example, if content of /path/to/input/text/file is like following
<html>
<head></head>
<body>
<a href="link.html">Link</a>
</body>
</html>Then output file will contain text as below
variableName : string =
' <html>' + LineEnding +
' <head></head>' + LineEnding +
' <body>' + LineEnding +
' <a href="link.html">Link</a>' + LineEnding +
' </body>' + LineEnding +
' </html>';Which actually a valid Pascal string variable declaration, which then can be included in Pascal program/unit source code.
var
{$INCLUDE output.inc}Credit
Original author is irfanbagus

