String manipulation help.

M

morc

hi,
I have a string thats been appended by a StringBuffer. It look as
follows:

091801_0.024_0~092708_0.0247_0~092734_0.025_0~092758_0.025_0~093014_0.025_0~093017_0.025_0~093017_0.025_0~

now its composed into three parts all speerated by "_" and ~ marks the
ending.

091801_ 0.024_ 0~

What i need is too find the highest value of the second column (0.024)

I'm not sure how i should do this. I thought of String Tokenizer but i
don't hink it woudl work.

If you guys have any suggestion it would be greatly appreciated.
Thanks
-morc
 
M

morc

please nevermind the above post as i figured out the problem.

But now im onto a different one :/

091801_0.024_0~
the first number indicates time
the second price
the third volume
i need to get the price for 9:30 and 4:30

but i do not know how to go about this.

if u have any suggestions it would be greatly appreciated.
thanks
-morc
 
O

Oliver Wong

morc said:
please nevermind the above post as i figured out the problem.

But now im onto a different one :/

091801_0.024_0~
the first number indicates time
the second price
the third volume
i need to get the price for 9:30 and 4:30

but i do not know how to go about this.

if u have any suggestions it would be greatly appreciated.
thanks

Don't know how you encode times (are those unix timestamps modulus the
number of seconds in a day or something?), but what's wrong with

<pseudoCode>
List returnValue = new ArrayList();

for (all rows) {
if (encode(9:30) == time || time == encode(4:30)) {
returnValue.add(price);
}
}

return returnValue;
</pseudoCode>

- Oliver
 
M

morc

091801 = 09:18:01
hours minutes seconds

I don't really understand what you mean Oliver.
All the values are put together with a string...
 
O

Oliver Wong

morc said:
091801 = 09:18:01
hours minutes seconds

I don't really understand what you mean Oliver.
All the values are put together with a string...

Okay, so you want EXACTLY the prices at 9:30 and 4:30, right? So look
for prices where the strings are "93000" and "43000". That's what I mean by
comparing the time to encode(9:30).

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top