please help with unix question I HAVE to sort a list by the ISBN NUMBER (the thr
ID: 3903583 • Letter: P
Question
please help with unix question
I HAVE to sort a list by the ISBN NUMBER (the thrid column) from an input file to a file.sh and sent to an out file.(file.out)
so the input file (file.input) would have a list
Donald Smith,Fire Lands,97868545414459
Adam Barry,The Armies,97564325678855
Jennifer Lelan,Childhood dreams,97546766544234
using a looping structure to procees the data and the titles Author Name of book ISBN. it will be in three columns.
please show example (with looping structure)of how to do it.
Explanation / Answer
You can place the following code in file.sh and execute.
sort -n -t, -k3 in.txt > out.txt
-----------
Description :-
Description:-
sort -n : Sort in numeric ascending order.
sort –t,: Use , as delimiter.
sort –k3: Use third column for sorting
in.txt > out.txt : after sorting content will copied to out.txt with help of pipe operator.
Please let me know if you have doubt, I am very happy to help you !!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.