I have like 4 columns in a file, each column contains a number of values, more or less. I need to get all possible combinations, while order of columns and number of sections in resulting strings should remain the same.
E.g. first column contains numbers ranging 1-100, second: letters a-z, and the third one is also numeric, I would get something like
1-A-1, 2-A-1, 3-A-1; 1-B-1, 1-B-2, 1-B-3 and so on.
There are various general-purpose approaches to this, but the simplest for a case where you know exactly how many columns you’ve got is just to use nested loops:
Alternative using LINQ: