Another glorious day in scripting heaven, when all of a sudden a wild request appears. I need to create a script that checks two files together that have the same name but a different extension. i.e. (*.in) and (*.out)
So far I have managed to get the information I need from the *.in file but I have no idea how to check it against the information in the .out file.
Also I need to check that the file names(without the extension match)
This is my code so far:
my @files = <*.in>;
for my $file (@files)
open my $read, '<', $file;
open my $write, '>', "$file.log";
@lines = split('', $_);
if($. == 3)
$scid = substr $_, 72,6;
print $write "$scid\n";
#check where files match
At the moment it only prints the unique identifier from the *.in the file to a seperate file to check that this is correct.
The identifier is A00000 (one alpha 5 numeric) and is the 72nd bit offset from the 4th line, in the *.in file. However is 2nd line in and the 28th bit across in the *.out file. Please help!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||