On Monday, 8 January 2018 at 05:38:44 UTC, thedeemon wrote:
On Sunday, 7 January 2018 at 17:30:26 UTC, Vino wrote:
I tried to manipulate the writeln's as below but the output
is not as expected as it prints the data in row wise, where as
we need it in column wise.
You've said before you need 6 different files, not some tables.
Also, after the "compression" data columns will have different
length. How exactly do you want to combine them into a table?
Hi Deemon,
The output required is like this,
(1) Read a table data form the csv file
John, America,23
John, India, 22
Astro, Canada, 21
2) Sort and remove the duplicates from each column by column
Take a copy of each column and sort and remove the duplicates
(col.dup) and store the resultant data of each column in seprate
files like below.
Column 1 ( Store the data to text Datafille1)
Astro
John
Column 2 ( Store the data to text Datafille2)
America
Canada
India
Column 3 ( Store the data to text Datafille3)
21
22
23
Using the function countUntil find the keys for each of the
column and store the result of each column in another files.
Key for column to text Keyfille1
original column1[].map!(v => Sorted Column1[].countUntil(v)) );
Key for column to text Keyfille2
original column2[].map!(v => Sorted Column2[].countUntil(v)) );
Key for column to text Keyfille3
original column3[].map!(v => Sorted Column3[].countUntil(v)) );
From,
Vino.B