Shell program to convert any text file content as Pascal quoted string variable
- FreePascal >= 3.0
Clone this repository and run FreePascal compiler.
$ fpc txt2inc.pas
$ ./txt2inc /path/to/input/text/file /path/to/output/file variableName
For 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}
Original author is irfanbagus