Hi Folks, I'm parsing the below text. But first, I want to remove the letters "CFP" and replace it with a line feed ("\n"). The line feed character would be placed right after the "KGS," for example. I tried to pass a String object of the text into a StringBuffer and use the StringBuffer's replace method, but that didn't seem to work. I'm hoping that someone could offer some suggestions.
But here's another problem. The text that's being parsed is more than just the above block. I'm trying to break the text into blocks like the one above so it's easier to handle. But for some reason this text has two of the same blocks.
As you can see, the only difference between the two blocks is the "CFP" and the "SHP." I want to grab the first one and ignore the second while removing the "CFP." Although it's optioinal I guess to remove the "CFP." Any suggestions would be appreciated. [ April 07, 2003: Message edited by: Chris Cairns ] [ April 07, 2003: Message edited by: Jim Yingst ]
Let me restate the problem. I found that the text is formatted very sloppy and I need to reformat it. I'm going to paste the whole thing so you can understand my problem.
What I need to do is cut off the text from 0 to 69 as a substring. So if you take a look at the top of the text, you'll see "1CFP." That text including anything to the right needs cut off. I tried spiltting the string and grabbing a substring from positions 0 to 69 for each line. But I got OutOfBounds exception. Not sure what to try next.
Joined: Jan 31, 2003
I think the Exception is occurring because of Row 0. When I used String records = text.split("\n") to break into lines -- from which I'd grab substrings -- I got a print out that row 0 is null.