Skip to main content
Participant
June 19, 2006
Answered

Building formatted ascii file

  • June 19, 2006
  • 2 replies
  • 415 views
Is there any way to use cftable to create a formatted ascii output file?

Or any other easy way to create a formatted ascii output file?

I need to query a database (easy), and format the output so that specific fields fall into specific locations within each output record. (aka fixed format ascii).

I can output the format to screen using cftable and cfcol in the exact layout I want. But I haven't figured out an easy way to output to a file.

I know this must be easy -

Thanks,
    This topic has been closed for replies.
    Correct answer JMGibson3
    Well you're right about it being easy. It is, however tedious. Sample writes a query of a weekly front-end payroll time query to a flat file for import by a back-end number cruncher. All fields are left-just trailing spaces (add your own variants for leading, etc.) VL means virtual line. Windows environment so we do both CR and LF. WeekEnding and Empno are common to all , the ZZZZZ gyration is for a control trailer and the rest speaks for itself (I hope).

    2 replies

    bmyersAuthor
    Participant
    June 20, 2006
    Thanks, that works.

    Bill
    JMGibson3Correct answer
    Participating Frequently
    June 19, 2006
    Well you're right about it being easy. It is, however tedious. Sample writes a query of a weekly front-end payroll time query to a flat file for import by a back-end number cruncher. All fields are left-just trailing spaces (add your own variants for leading, etc.) VL means virtual line. Windows environment so we do both CR and LF. WeekEnding and Empno are common to all , the ZZZZZ gyration is for a control trailer and the rest speaks for itself (I hope).