on 08-24-2010 11:08 PM
Hi java gurus,
i hv a small requirement,
I need to put last column(delperiod.substring(0,4)+"01") at 173-183 locations.
Now, with the below code, it is just attaching at the end of row(124-130).
result.addValue( contractNo + tmpqtystr1 + price + delperiod.substring(0,4)+"01" + condate + shipwts + mtype + cif + comtype + rejreason
+ type + usrname +impdate + imptime + delperiod.substring(0,4)+"01" );
pls help me with java code.....
santosh.
Hi Santosh,
if you need the content : delperiod.substring(0,4)+"01") at 173-183 position, you need to make sure that the preceding content of it should be ending at 172nd position.
You can get it by using the following code.
String Output="";
String temp=contractNo + tmpqtystr1 + price + delperiod.substring(0,4)+"01" + condate + shipwts + mtype + cif + comtype + rejreason + type + usrname +impdate + imptime;
int strlen= temp.length();
for int(i=strlen;i<173;i++)
{
Output=Output.concat(" ");
}
Output=Output.concat(delperiod.substring(0,4)+"01");
result.addValue(Output);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Location of delperiod.substring(0,4)+"01") will depend on length of other varaibles used in the code such as contractNo + tmpqtystr1 + price,
also length of delperiod.substring(0,4) will be 5 and length of "01" will be 2, it total it is 7, but you want it at location 173-183 for which length is 11.
so what is the logic of the length you want to use.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.