On Fri, 05 Nov 2004 13:18:00 -0500, Dustin Frank wrote:
>ASA carriage controls work with fixed length lines. Column one of every line
>tells the carriage what to do before printing that line. Using ASCII terms for
>example:
>"1" = formfeed
>" " = carriage return with line feed
>"+" = carriage return w/o line feed (for impact printing)
>"0" = carriage return with line feed twice
>There are several more, but you get the idea. My goal is to output column one
>as " " for every line that does not have a formfeed, and with those output "1"
>in column one.
Without an example it's not easy to answer. Especially the handling of
FormFeeds still has to be done.
The following may help you a bit (hopefully ;-)
// first pad the lines to desired length
// (e.g. via {Edit, Convert, All lines same length})
// (may be included here for convenience)
//
// now some preparations:
// to have a leading CR/LF:
Begin_Of_File
Ins_Newline(1)
// remove CR/LF from last line
// (assuming that all lines are terminated with CR/LF!!!)
End_Of_File
Replace("|N", "", REVERSE+NOERR)
// then the conversion:
// replace all newlines with a space:
Replace("|N", " ", BEGIN+ALL+NOERR)
Update // to hide a display bug in VEDIT
//-----------------------------------------
// to do: replace the FF appropriately
// (I don't know where it is placed: alone in a line or at EoL)
//Replace("|H0C", "1", BEGIN+ALL+NOERR)
// or
// (assuming that FF is following a CR/LF)
//Replace("|N|H0C", "1", BEGIN+ALL+NOERR)
//
//(one have to pay attention to the correct padding in lines with FF!)
Christian
|
|