linux - populate values in columns of excel sheet using shell script -
i trying generate script stores values excel sheet in column wise. eg: have stationery, books category, , pen, pencil, can win book items. need following output.
____________________________________ |_ stationery______ | pen __________| |__books___________ | can win | |___________________|_______________|
edits based on comments: if assume starting file file:
cat file a, b, c, d, then replace a, b, c, , d array of items:
array=("a" "b" "c" "d") array2=("stationery" "pen" "books" "you can win") a=$(<file) ((i=0;i<${#array[@]};++i)) a=${a//"${array[i]}"/"${array2[i]}"} echo "$a" > file.csv done of course array2 can contain want. if want .xlsx file type, using ssconvert:
ssconvert --export-type=gnumeric_excel:xlsx file.csv file.xlsx here's man page ssconvert http://linuxcommand.org/man_pages/ssconvert1.html. that's installed part of gnumeric.
Comments
Post a Comment