perl files manipulation - TechRepublic
General discussion
May 20, 2008 at 02:19 AM
alvinrosenburg

perl files manipulation

by alvinrosenburg . Updated 18 years, 2 months ago

hi,

i’m looking for a way in perl scripting to find a smallest number in a file (SEQ.TXT) and compare against another file (AVAILABLE_SEQ.TXT). if the smallest number is not in AVAILABLE_SEQ.TXT, script will skip to the next smallest number in SEQ.TXT & continues searching until it finds it and proceed with further scriptiign.

i’ve tried using the sub function to return smallest number but it doesn’t work with looping.

can anyone help?

E.g
(1) 22.5 is the smallest in SEQ.TXT but not in AVAILABLE_SEQ.TXT
(2) skip to the next smallest number 24.2 but still not in AVAILABLE_SEQ.TXT
(3) skip to the next smallest number 25.6, found. use this to do further processing

SEQ.TXT AVAILABLE_SEQ.TXT
——- —————–
22.5 8.9
24.2 9.1
25.6 9.5
125 20.3
33.3 25.6
39.3

This discussion is locked

All Comments