Topic: Newline with Formfeeds to FORTRAN (1 of 4), Read 32 times
Conf: Converting, Translating
From: Dustin Frank
Date: Friday, November 05, 2004 12:35 PM

Hello, I receive text output from a system that originally outputed in fortran, but that vendor has switched the output to ascii, and my parsing utility handles the fortran output, but the new utility to do it will not be ready for another few months.
I would like to know how to convert a text file with standard ascii controls (CR LF & FF) to Fortran controls. I have padded the lines, stripped the CRLF and replaced the FF with 1 in column one. The problem I am running into is this does not add the control column in position one, and my parsing app interprets all of those values as fortran controls.

 


Topic: Re: Newline with Formfeeds to FORTRAN (2 of 4), Read 35 times
Conf: Converting, Translating
From: Christian Ziemski
Date: Friday, November 05, 2004 12:55 PM

On Fri, 05 Nov 2004 00:35:00 -0500, Dustin Frank wrote:

> I would like to know how to convert a text file with standard ascii controls
> (CR LF & FF) to Fortran controls. I have padded the lines, stripped the CRLF
> and replaced the FF with 1 in column one. The problem I am running into is
> this does not add the control column in position one, and my parsing app
> interprets all of those values as fortran controls.

It would be helpful if you can provide an example with more details.
Not everyone knows Fortran controls... (me neither)

Christian

 


Topic: Re: Newline with Formfeeds to FORTRAN (3 of 4), Read 41 times
Conf: Converting, Translating
From: Dustin Frank
Date: Friday, November 05, 2004 01:18 PM

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.

 


Topic: Re: Newline with Formfeeds to FORTRAN (4 of 4), Read 34 times
Conf: Converting, Translating
From: Christian Ziemski
Date: Friday, November 05, 2004 02:55 PM

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