Hi Guyz
I designed a script that can compare 2 columns(values) of single file and gives the closest numbers to the first column by comparing the numbers in first column with second and it works in a single file.
Quote:
INPUT OUTPUT
Singlefile Singlefile
1stC 2ndC 1stC 2ndC
100 512 100 90
200 612 200 245
300 90 300 309
400 309 400 400
500 245 500 512
600 400 600 612
Now I'm trying to design a new script with 2 objectives for
2 files (not a single file like previous one). This new file contains a new column in both files containing A1-A22 and A-X and A-Y symbols randomly (the order of symbols in both files are may be different or may be not).
Objective1. Make a loop that can coonect the same symbols of 2 files and runs the script for closest numbers in those values. for Example
A-X in INPUT1 1st file has 100 - The script has to search every A-X in INPUT2 2nd File and take the closest of those values i.e A-X
90
Quote:
INPUT1
1st File
1stC 2ndC
A1 100
A1 200
A-X 300
A-20 400
A-2 500
A-10 600
INPUT2
2nd File
1stC 2ndC
A-X 512
A11 612
A-X 90
A-20 309
A-21 245
A-7 400
OUTPUT
Singlefile
1stC 2ndC
A-X 90
A-20 309
Objective 2. Print the results to a single file
OUTPUT
I'm here by including my script and examples of input and output files to make it easy for you to understand.
Thanx in advance and your valuable time.
Hope I'll get clue.