Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing Headache - Please Help

 
Chris Cairns
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the problem. I need to cutoff any text to the right of and including the following words: "1CFP", "CFP", "1TNK", "TNK", "1AL1", "Al1", "1ATC", "ATC", "1WBL", "WBL", "1SHP", "SHP". (See full text below.) The constraint is that I cannot use methods or packages from Java 1.4, just 1.3. This means no regex and no strObj.split(param). (I used the latter successfully to cutoff the text, but then found out that it had to be compatible with version 1.3). I've tried a few approaches with no success. I must admit, my problem is with the logic. So I'm hoping that someone could give me some pointers. I'd really appreciate it.

[ April 08, 2003: Message edited by: Chris Cairns ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe something like this:

Here's the output:
 
Chris Cairns
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what I can do is grab the character length of each row. If it's greater than 69, then I'll grab a substring from 0 to 69. If not, then don't grab a substring.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic