Okay so when i read each line of a file created on windows it should end with \r\n. So to split out each line i could say
split(/\r\n/,$file);
The problem i have is that i am trying to search and file for certain values like.
open(FF, "$fixmessageloc");
while(<FF>){
chomp($_);
if($_ =~ /35=D/){
printf("Found $_\n");
}
}
<code>
Now this will return .
<code>
Found 1 06/02/23 11:16:05:390 Inbound:, Outbound:, Bidirectional:***
2 06/02/23 11:16:05:390 Received FIX message
Message dump:
3 06/02/23 11:16:05:390 Resetting FIX session intraday.
4 06/02/23 11:16:05:406 Sent FIX Message
Message dump:
5 06/02/23 11:16:35:109 Sent FIX Message
Message dump:
6 06/02/23 11:16:37:234 Received FIX message
Message dump:
7 06/02/23 11:16:37:234 Sent FIX Message
Message dump:
8 06/02/23 11:16:37:265 Inbound:, Outbound:, Bidirectional:***
9 06/02/23 11:16:44:671 Received FIX message
Message dump:
Which is the whole file, and not the line i want.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.