porno porno rokettube
Results 1 to 2 of 2

Thread: Multiple lines String problem

  1. #1

    Multiple lines String problem

    I have a multiple lines String like:

    >name 1
    zzzzzzzzzzzzzzzzzzzz
    zzzzzzzzzzzzzzzzzzzz
    zzzzzzzzzzzzzzzzzzzz
    >name 2
    zzzzzzzzzzzzzzzzzzzz
    zzzzzzzzzzzzzzzzzzzz
    zzzzzzzzzzzzzzzzzzzz

    line that contains > is the name of something, and other lines down contains data of something. My String is very big, I want to return the name of something without > and its data (ZZZZZ) separate and access to it after that. which structure is best to do this and how I can implement that. I'm new using groovy
    Please help

  2. #2
    Junior Member
    Join Date
    Apr 2010
    Location
    Delaware USA
    Posts
    11
    Looks like you're parsing a FASTA sequence file which you can do easily with a mix of java and groovy
    so iterate through the file using the eachLine closure of File . Have a class that stores name and sequence separately.
    go through each line testing for the > and completing the previous object when it is encountered, peeling off the >
    from the name variable with regular expression substituting.

    There's a lot of info out there about all these concepts and I wouldn't be surprised at all if someone doesn't have a freely available fasta parser.
    Will

    Programming Groovy by Subramaniam, and Groovy In Action by Konig are both excellent resources as well as the Core Java
    I and II books.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Forum Design by Tucanoo Solutions Ltd Grails Development Specialists.