6 kyu
Sort the columns of a csv-file
118 of 1,068user5036852
Description:
#Sort the columns of a csv-file
You get a string with the content of a csv-file. The columns are separated by semicolons.
The first line contains the names of the columns.
Write a method that sorts the columns by the names of the columns alphabetically and incasesensitive.
An example:
Before sorting:
As table (only visualization):
|myjinxin2015|raulbc777|smile67|Dentzil|SteffenVogel_79|
|17945 |10091 |10088 |3907 |10132 |
|2 |12 |13 |48 |11 |
The csv-file:
myjinxin2015;raulbc777;smile67;Dentzil;SteffenVogel_79\n
17945;10091;10088;3907;10132\n
2;12;13;48;11
----------------------------------
After sorting:
As table (only visualization):
|Dentzil|myjinxin2015|raulbc777|smile67|SteffenVogel_79|
|3907 |17945 |10091 |10088 |10132 |
|48 |2 |12 |13 |11 |
The csv-file:
Dentzil;myjinxin2015;raulbc777;smile67;SteffenVogel_79\n
3907;17945;10091;10088;10132\n
48;2;12;13;11
There is no need for prechecks. You will always get a correct string with more than 1 line und more than 1 row. All columns will have different names.
Have fun coding it and please don't forget to vote and rank this kata! :-)
I have created other katas. Have a look if you like coding and challenges.
Strings
Arrays
Algorithms
Sorting
Similar Kata:
Stats:
Created | Oct 7, 2016 |
Published | Oct 7, 2016 |
Warriors Trained | 2668 |
Total Skips | 140 |
Total Code Submissions | 4265 |
Total Times Completed | 1068 |
C# Completions | 118 |
JavaScript Completions | 324 |
Java Completions | 162 |
Python Completions | 407 |
TypeScript Completions | 95 |
CoffeeScript Completions | 9 |
C Completions | 19 |
Total Stars | 81 |
% of votes with a positive feedback rating | 94% of 282 |
Total "Very Satisfied" Votes | 253 |
Total "Somewhat Satisfied" Votes | 26 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 8 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 6 kyu |