Here is a task. You need to write a console one-liner to parse csv file that contains
information about some objects in the Solar System. You can use cat
, sort
and some other common tools that are available in console. Because this site
is dedicated to Perl language it recommended to use perl
command, but if you like,
you can use awk
and sed
.
In you current working directory there is a file solar-system.csv
with such
content:
name,mass_to_earth,orbital_period
Earth,1,365.256363004
Jupiter,317.8,4332.59
Mars,0.107,779.96
Mercury,0.055,87.9691
Moon,0.606,27.321661
Neptune,17.147,60182
Pluto,0.00218,90560
Saturn,95.159,10759.22
Uranus,14.536,30688.5
Venus,0.815,224.701
As you can see it is a CSV file. The first line is a header and all the other lines are data.
The separator is a comma symbol. The data is written as is, there is no quotes.
There are three columns in this file:
Your task is write a command that output to STDOUT part of this data in a different form.
To submit solution you need to
login or
register.