2007 Sep 20 8:31 AM
Hi all,
I have a flatfile which has 7 fields which I need to format.
The requirement is for every row in the flatfile, I have to check
FOR EVERY ROW in <flatfile>
IF NUMERIC Field
Right-justify field value & Pad with leading zeroes to the LEFT.
WRITE FIELD to <flatfile>
ELSE IF ALPHANUMERIC FIELD
Left-justify field value and Pad leading spaces to the RIGHT.
WRITE FIELD to <flatfile>
ENDIF
Please help me with the sample code.
Thanks and regards,
Anishur
Hi all,
I have a flatfile which has 7 fields which I need to format.
The requirement is for every row in the flatfile, I have to check
FOR EVERY ROW in <flatfile>
IF NUMERIC Field
Right-justify field value & Pad with leading zeroes to the LEFT.
WRITE FIELD to <flatfile>
ELSE IF ALPHANUMERIC FIELD
Left-justify field value and Pad leading spaces to the RIGHT.
WRITE FIELD to <flatfile>
ENDIF
Please help me with the sample code.
Thanks and regards,
Anishur
2007 Sep 20 7:28 PM
I hope you don't need a code sample for how to read a file...
For "number / not number" validation and right-justify you can find a sample here:
http://friendlyabaper.blogspot.com/2006/10/fun-with-numbers.html
"Left-justify" - use SHIFT LEFT DELETING LEADING space.
Hope this helps.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |