Skip to content

Shell program to convert any text file content as Pascal quoted string variable

License

Notifications You must be signed in to change notification settings

zamronypj/txt2inc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

txt2inc

Shell program to convert any text file content as Pascal quoted string variable

Requirement

Compilation

Clone this repository and run FreePascal compiler.

$ fpc txt2inc.pas

Run

$ ./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}

Credit

Original author is irfanbagus

Multiline string constant discussion

About

Shell program to convert any text file content as Pascal quoted string variable

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages