Jun-14-2022, 02:50 PM
Ok so I have a cvs with these information (I am using pipes and not commas):
1 | A | B
1 | C | D
2 | E | F
I need a code that does this:
If the first element of the row is the same as first element in the row above or below, then print that first element. I need this only for the first occurrence.
So in the case of 1 | A | B it should print "1" because it is the first occurrence in the cvs file. In case of the second row 1 | C | D it should do nothing because it's the second occurrence.
I don't know how to solve this. I know how to read the cvs file and get the elements.
1 | A | B
1 | C | D
2 | E | F
I need a code that does this:
If the first element of the row is the same as first element in the row above or below, then print that first element. I need this only for the first occurrence.
So in the case of 1 | A | B it should print "1" because it is the first occurrence in the cvs file. In case of the second row 1 | C | D it should do nothing because it's the second occurrence.
I don't know how to solve this. I know how to read the cvs file and get the elements.