velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gagan 007 <gagan007in...@yahoo.com>
Subject Re: File format contains the fixed size s# with left padded 0, can we do this in Velocity?
Date Sat, 12 Mar 2005 09:10:10 GMT
Thanx chen , i will look check this

jian chen <chenjian1227@gmail.com> wrote:You could use the jakarta commons library.
The actual file is:
org.apache.commons.lang.StringUtils. It has various padding methods.
Just pass the StringUtils into velocity context.

Cheers,

Jian


On Fri, 11 Mar 2005 11:21:07 -0800 (PST), Gagan 007
wrote:
> 
> I have to show some file in this format
> 
> S# Value
> 
> 0001 abc
> 0002 adc
> 0003 afc
> 0004 sbc
> 0005 fbc
> 0006 abh
> 0007 afc
> 0008 sbc
> 0009 fbc
> 0010 hbc
> 0011 alc
> 0012 a;c
> 0013 a'b
> 0014 ab[
> 0015 ayc
> 0016 a5c
> 0017 ab4
> 0018 a3c
> and so on
> 
> 0100 abc
> 
> I have all the values in the collection and i m iterating through it...
> Plus i need to show the S#... which gets incremented with each value...as shown above...
> 
> The size of the sequence no.. is 4 digits.. if there are not 4 digits then the s# is
left padded with 0
> u can c the example above...
> 
> Is there any feature in Velocity to generate this S# while i m iterating through the
values...
> 
> Its urgent any help would be appreciated..
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail - You care about security. So do we.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org



		
---------------------------------
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site! 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message