CSV to html – grouping data

It’s easy to group data based on a specific column. You simply use groupby_col.

Original

SR.NAMEGENDERAGEDATE COUNTRY
1Dett2Male1821/05/2015Great Britain
2Nern Female1915/10/2017France
3KallsieMale2016/08/2016France
4SiuauFemale2121/05/2015Great Britain
5ShenniceMale2221/05/2016France
6ChasseFemale2315/10/2018France
7TommyeMale2416/08/2017United States
8DorcastFemale2521/05/2016United States
9AngeleeMale2621/05/2017Great Britain
10WilloomFemale2715/10/2019France

Group by column

This example below show how grouping is done by the gender – column.

[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" groupby_col="3"]
SR.NAMEGENDERAGEDATE COUNTRY
Female
1Dett2Female3616/08/2020Great Britain
2Nern Female1915/10/2017France
4SiuauFemale2121/05/2015Great Britain
6ChasseFemale2315/10/2018France
8DorcastFemale2521/05/2016United States
10WilloomFemale2615/10/2019France
Male
3KallsieMale2016/08/2016France
5ShenniceMale2221/05/2016France
7TommyeMale2416/08/2017United States
9AngeleeMale2621/05/2017Great Britain

If you don’t want to show the gender column, you can just exclude it with exclude_cols.

[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" groupby_col="3" exclude_cols="3"]
SR.NAMEAGEDATE COUNTRY
Female
1Dett23616/08/2020Great Britain
2Nern 1915/10/2017France
4Siuau2121/05/2015Great Britain
6Chasse2315/10/2018France
8Dorcast2521/05/2016United States
10Willoom2615/10/2019France
Male
3Kallsie2016/08/2016France
5Shennice2221/05/2016France
7Tommye2416/08/2017United States
9Angelee2621/05/2017Great Britain

If sorting is done when grouping by a column, sorting is done by column firstly but then each group is sorted invidually. This is an example where sorting is done on the name-column.

[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" groupby_col="3" exclude_cols="3" sort_cols="2"]
SR.NAMEAGEDATE COUNTRY
Male
9Angelee2621/05/2017Great Britain
3Kallsie2016/08/2016France
5Shennice2221/05/2016France
7Tommye2416/08/2017United States
Female
6Chasse2315/10/2018France
1Dett23616/08/2020Great Britain
8Dorcast2521/05/2016United States
2Nern 1915/10/2017France
4Siuau2121/05/2015Great Britain
10Willoom2615/10/2019France