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.