How to make interpolation printing at fixed position?
HawkCoretech <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I have a special requirement. I need to make some interpolation printed in fixed position without being affected by length of previous one in the same row. because the output txt file will be read by another program, so it has to follow a strict format. for example, a template file: A=$a B=$b 1234567890 current $b is at the 9th-char position, but if value of $a is longer than 2 chars, the $b starting position will not be at 10th-char. if $a=xy, $b=gh, output: A=xy B=gh but if $a=wxyz $b=gh, the output is: A=wxyz B=gh if I want B=$b is always printed at the fixed position(9th-char), it seems the only way is to make the length of $b's prceeding interpolation fixed. of course, this means some data in $a might be trimed. There is no such directive or built-in to do this. I think maybe I should write a user-defined directive to perform this function. Does any one has any suggestion? Thanks. -- View this message in context: http://www.nabble.com/How-to-make-interpolation-printing-at-fixed-position--tp20005931p20005931.html Sent from the freemarker-user mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/