I have 20 excel files having 6x6
rows and columns, where the first row and column are string headers. Each of these files has 4 same columns and row headers except 1 different. I want to know how I can modify them so that the the columns and rows with the same header in each file will have the same order, while the different row and column will always be the last one.
So for example:
If a.csv
looks like this:
a b d c x
a 1 2 3 5 3
b 2 2 5 5 2
d 2 3 4 4 6
c 5 5 6 6 5
x 3 1 6 7 9
and b.csv
looks like this:
d c b a y
d 2 3 6 5 3
c 5 2 6 6 5
b 6 4 2 3 4
a 6 4 4 6 2
y 5 3 6 7 9
and c.csv
looks like this:
a c d b z
a 3 3 5 5 2
c 5 4 6 6 1
d 7 4 5 7 2
b 3 2 6 6 7
z 5 3 6 4 7
and so on.... for all the 20 files
This is how I want them to look:
a.csv
:
a b c d x
a 1 2 5 3 3
b 2 2 5 5 2
c 5 5 6 6 5
d 2 3 4 4 6
x 3 1 7 6 9
b.csv
:
a b c d y
a 6 4 4 6 2
b 3 2 4 6 4
c 6 6 2 5 5
d 5 6 3 2 3
y 7 6 3 5 9
same with c.csv and the rest of the excel files.
TAB a TAB b TAB c ...
, or is itSPACES a SPACES b SPACES c ...
. AFAICT, excel can create the former syntax, which would have advantages, since then every line would have 6 elements, where the first element of each first line would be the empty string. (In case of SPACES we had to differenciate two cases; the header line with five fields, and the data lines with 6 fields). Also formatting would be easier in case of TABs. – Janis Apr 13 '15 at 10:04od -c a.csv
to be sure about the format. – Janis Apr 13 '15 at 13:11