
linebreak.pxp v1.0

It is the awk program to split long lines in text to shorter.

When run without parameters, linebreak.pxp outputs its version and usage format.

(c)2026, Vartiklis, Jonas Skendelis. The linebreak.awk is distributed 
under MIT License (see license.txt file) allowing to use, copy, modify, 
merge, publish, distribute, sublicense, and/or sell its copies. 
Its copyright notice and license text shall be included in all copies 
or substantial portions of this Software.


Usage
_____

As PXP Plus works as interpreter and does not compile source into
executables (EXE), linebreak.pxp must be run only using _pxpplus_
program. The needed parameters must be provided to the program.

The parameters mus be only in strict order. First two are input and output files.
After then could be parameters MIN and MAX to control line lengths
(as well as in uppercase or lowercase an d their order is not important). 
They are not mandatory and if are ommited, the default values 68 and 80 are used.
Jie nra btini ir jei praleisti, tai naudojamos nutylimosios reikms 68 ir 80.
All other usages cause error message.

So format of parameters is:

initial_file output_file [MIN=nn] [MAX=nn]
wherw nn  integer numbers and MIN <= MAX

As PHP Plus do not compile source code into executable and is the interpreter,
paraneters for linebreak.pxp must be provided when calling PXP Plus. 
PXP Plus allows compile source code into intermeddiate byte code,
so it is possible to provide it when calling PXP Plus. For example

pxplus -arg initial_text.txt splitted_text.txt MIN=70 MAX=102 linebreak.pgm

Another way - run PXPPLUS with the same parameters (as in previous wxample,
but without program name) and then Load source code and execute (Run) it in
PXP Plus environment.

Kitas bdas  ikviesti PXPPLUS su parametrais (kaip ankstesniame pavyzdyje,
tik be programos vardo), o tada kelti (Load) pradin programos kod (linebreak.pxp)
ir j vykdyti PXP Plus aplinkoje.


Detailed description
____________________

Two parameters are used to control splitting: one to define the minimal 
length and another to define maximal length. A line part till minimal 
length is kept as is and then further the space is searching to make 
the split in that position. If space was not find then break happens 
at maximal length position.

The command below reads a text from file initial_text.txt and breaks 
line leaving at least of 70 symbols but not longer as 102 symbols. The 
break will be done at first space after 70th position. The result will 
be to written into file splitted_text.txt


pxplus -arg initial_text.txt splitted_text.txt MIN=70 MAX=102 linebreak.pgm


Other versions
______________


linebreak is  implemented too using other languages:
Perl, AWK, C and C++
No plans to update linebreak.pvx for PXP Plus with new features or make more 
flexible its usage.
