Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^14: how to read input from a file, one section at a time?

by davi54 (Sexton)
on Apr 02, 2019 at 17:40 UTC ( [id://1232035]=note: print w/replies, xml ) Need Help??


in reply to Re^13: how to read input from a file, one section at a time?
in thread how to read input from a file, one section at a time?

Hi Poj,
Can I get your email ID if that's okay with you? I can send you the complete script and you can help me with my struggle.
  • Comment on Re^14: how to read input from a file, one section at a time?

Replies are listed 'Best First'.
Re^15: how to read input from a file, one section at a time?
by poj (Abbot) on Apr 02, 2019 at 17:43 UTC
Re^15: how to read input from a file, one section at a time?
by davi54 (Sexton) on Apr 02, 2019 at 17:54 UTC
    I posted the test file and the script in the scratchpad. Again thanks for everything Poj. I really appreciate your effort.

      I suspect the problem is trailing whitespace (carriage returns, line feeds, spaces etc) on your sequences

      # Remove comment line(s) $para =~ s/^\s*#.*//mg; # Trim trailing white space $para =~ s/\s+$//; # add this ..
      poj
        Hi,
        That fixed the issue. Thank you so much.
        I have a related question. Is there a way to remove all the duplicate entries and/or replace them with a newline character? Duplicates are skewing my data.
        Also, there are some entries which have incomplete sequences and have the word "(Fragments)" in the header. Can you suggest a way to delete all those entries with the word (Fragment) in their header?
        Thanks again for all your help Poj. I will be presenting this data at a conference in Winnipeg next month. I would be happy to acknowledge your help in this work. Please let me know if you want me to do that.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1232035]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-25 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found