This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes  extract and print out for testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » I/O and Streams
Bookmark " extract and print out for testing" Watch " extract and print out for testing" New topic

extract and print out for testing

Johnny Woosh

Joined: May 16, 2005
Posts: 10
hey there, i haf a jsp page which reads in two of it is to read a filename and then read its contents.The problem is, the file contents contains entries like "MEASURE Waist_Full=33.19".What i wanna do is to only extract "Waist_Full" and "33.19" and print it out for testing.But i cant seem to do it.Any help will be appreciated.

[ July 07, 2005: Message edited by: Bear Bibeault ]
Chit Ming Chong
Ranch Hand

Joined: Sep 09, 2004
Posts: 49
Aeasier way may be to use the String replaceAll() function on a line.

i.e. processedText = text.replaceAll("^MEASURE ", "");

will take out "MEASURE " from the beginning of a line
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63208

Not much to do with JSP so moving onto the I/O forum (and with a better subject).

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: extract and print out for testing
It's not a secret anymore!