Sample Data:
603 Some garbage data not related to me, 55, 113 ->
1-ENST0000 This is sample data blh blah blah blahhhh
2-ENSBTAP0 This is also some other sample data
21-ENADT)$ DO NOT WANT TO READ THIS LINE.
3-ENSGALP0 This is third sample data
node #4 This is 4th sample data
node #5 This is 5th sample data
This is also part of the input file but i dont wish to read this.
Branch -> 05 13,
44, 1,1,4,1
17, 1150
637 YYYYYY: 2 : %
EDIT: In the above data. The column width is fixed for the sections but there might be some sections I do not wish to read. above sample data has been edited to reflect that.
So in this input file I want to read contents of first section ‘1-ENST0000’ into an array and contents of ‘2-ENSBTAP0’ into a separate array and so on.
I am having trouble coming up with a regex that will define the pattern …first three lines have <someNumber>-ENS<someotherstuf> and then there can also be node #<some number here>
OK, based on your later comment, this is a little different than the previous question. Also, I now realize that
node #54is a valid entry in the first column.Update: I now also realize you do not need the first column.
Update: In general, you neither want to nor need to deal with character arrays in Perl.
Update: Now that you clarified the what should and should not be skipped, here is a version that deals with that. Add patterns to taste in the
ifcondition.As for learning how to fish, I recommend you read everything related in perldoc perltoc.