in reply to how to pair strings based on positional differences
One approach would be to open the data file, then use a while loop to read it in and split (on whitespace) to obtain the values. Store those values in an AoA (see perllol). Once the data has been read in, close the datafile.
Next, use another while loop to shift a set of values from the AoA, then grep the remainder of the AoA with your distance calculation. Save and/or print results. The loop terminates once the AoA is empty.
|
|---|