Results 1 to 2 of 2
  1. #1
    Join Date
    May 2009
    Posts
    1

    Unanswered: write string of characters to file

    Hi,
    I have a text file with a very long string of characters, like "ACGCTTGCAA...", and I want to make another file with 36 characters from this string file every 4 lines like:

    character of position 1 to position 36 of the string file, position 2-37, position 3-38 ... position length((string)-35)-length(string).
    And in the other lines of the file write always the same strings like below:

    @read
    AACCCAGTAAGTCACAGTGCANCAAACTTGTTTATT
    +read
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    @read
    ACCCAGTAAGTCACAGTGCANCAAACTTGTTTATTC
    +read
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    @read
    CCCAGTAAGTCACAGTGCANCAAACTTGTTTATTCA
    +read
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    So my question is, how can I do it?

  2. #2
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697
    The short answer is:

    perldoc -f substr

    The long answer is: What have you tried so far?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •