python - Check whether any part of row X of csv is in any of the following 8 rows. If yes, move row X. -
my program randomizes rows in csv file. there 120 rows 5 columns. first 2 columns each contain name of image. there 30 (out of 2 columns*120 rows=240) image names repeat, once each. repeat (second copy) of image name isn't in same column first 1 (it may in column 1 or 2), might be.
i need have program check whether each of 2 images in each row (columns 1 , 2) in 1 of following 8 rows. if is, need move row second instance of image end of file. need check again (because images repeat twice), , if finds repeat, need put second repeat row somewhere else in file. don't care where, long it's not within 7 rows of target row (the 1 being tested).
Comments
Post a Comment