I am new to java (normally program in perl and bash).

I have an array that has X amount of rows that look like this:

2011-02-24,XXXDAO_456912 - (none) - (direct),(none),(direct),(not set),(not set),0,5447,1,3639.71,3521.86,0,0

What I need to do is take this column - XXXDAO_456912 - (none) - (direct) - and extract only the number - 456912. I can and have done this in perl/bash but so new to java I am not sure where to begin. Google has given me some info but not everything.

Any help would be greatly appreciated.

7 Years
Discussion Span
Last Post by jfountai

Am I correct in thinking the whole thing is an array of Strings, each row is a String?
If so, you can use Java's regex which is not too far from perl's. The major difference is that regexen are created as Strings, which means you have to worry about escaping characters correctly. You're probably familiar with regex from perl - google will find you good information on java regex, and that should sort you out.


Yes, the entire thing is an array of strings. thank you, I will search out java regex.

Thank you!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.