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: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!use strict; my @files = <*.in>; for my $file (@files) { open my $read, '<', $file; open my $write, '>', "$file.log"; my $scid; my @lines; while(<$read>) { @lines = split('', $_); if($. == 3) { $scid = substr $_, 72,6; print $write "$scid\n"; } } #check where files match close($read); }
In reply to Find a file with same name but different extension by Jalcock501
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |