A CSV file is characterized by a header, describing the n datarows to come. The header is a text string separated by a separator. A CSV header might look like (C1)Date;Time;ZIP-Code;Address;TemperatureAssume we have a second CSV file (C2) with this structure:Date;ZIP-Code;Address;TemperatureC1 and C2 are similar, but they are not the same: C2 lacks TimeAssume another C3:Time;Date;Address;ZIP-Code;TemperatureHere the same items as in C1 are present, but the order is different.What I am after is a metric which would give me the similarity between two sets, including the relative closeness of items with these two sets. In other words, if the order of items varies within one set, but the cardinality is the same, the similarity value should be bigger compared to different cardinality or if the cardinality is the same but the items itself vary.I came up with this preliminary mental measure. I could plot in a matrix              Date;Time;ZIP-Code;Address;TemperatureDate           1 Time                1ZIP-Code                    1Address                            1Temperature                                 1             Date;Time;ZIP-Code;Address;TemperatureTime           0    1     0         0       0ZIP-Code       0    0     1         0       0Address        0    0     0         1       0Temperature    0    0     0         0       1             Date;Time;ZIP-Code;Address;TemperatureTemperature    0    0      0       0        1Address        0    0      0       1        0ZIP-Code       0    0      1       0        0Time           0    1      0       0        0Date           1    0      0       0        0             Date;Time;ZIP-Code;Address;TemperatureHead1           0   0       0       0       0Head2           0   0       0       0       0Head3           0   0       0       0       0Head4           0   0       0       0       0My sense of similarity would be the more structure / pattern in the matrix, the more similar the tow CSV headers are.I wonder if there is a measure like Dice-Distance, Cosine-Similarity, Jaccard-Index which would be of help?
Similarity of two CSV files (or more?)
data analysis;data sets