Problems? Is your data what you think it is? | |
PerlMonks |
Re^2: Reversing the action of the while loopby Scotmonk (Sexton) |
on Nov 24, 2019 at 22:18 UTC ( [id://11109163]=note: print w/replies, xml ) | Need Help?? |
The problem, I feel, is complex but perhaps you guys are more practiced in dealing with computers so it might be easier. The difficult part of this is trying to make sense to you guys I have lines of data elements in a .vim file (this can vary between 5 data elements per line and 25) Each element is distinct from the others, regarded as a different sample I have been reading one line of data and comparing it with the previous x number of lines of data, looking for matches in value (which I have code for and can provide below) I now have to be more specific, in that I have to read the individual data from each line, and eliminating any replication, keep adding new values until I have x amount of values. so for example: my input data would look something like this 1 2 6 4 5 6 7 8 9 10 1 2 11 12 13 6 14 15 16 17 If I chose to read 13 elements of data, i would read 1 2 6 4 5 6 7 8 9 10 1 2 11 Now I need to remove duplicate values, in this case one of the 1, one of the 2, and one of the 11 (but values could be triplicated or more) so that would result in 1 2 4 5 6 7 8 9 10 11 This final line would then be compared with the next complete unread line in the file, with matches printed to one file and nonmatches printed to another as per the code below. (so the match file would read) 6 (and the nonmatch file would read) 14 15 16 17 Now there is actually another step to what I do on paper that I would like the PERL script to perform Initially I had chosen 13 values (and this can vary between 5 and upto 80) If it is the case that duplicates are removed, I dont have the 13 values that I originally planned for so on paper, I continue to read forward until I have my required number of values filled in (without duplicates) even if that means reading into more lines of data, and moving forward the line that I will eventually compare with Does this make any sense at all ? :) thankyou
In Section
Seekers of Perl Wisdom
|
|