Create an .csv/excel file using shellscript


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Create an .csv/excel file using shellscript
# 1  
Old 07-06-2011
Java Create an .csv/excel file using shellscript

In my file, i have 4 Product names(For ex:Microsoft excel, Oracle,.Net,IBM websphere,..etc.,) I want this 4 Products in 4 individual .csv/excel file after running the script with those products related information.
Navya
# 2  
Old 07-06-2011
In my file, i have 4 Product names -- where is your file ? how it looks like ?
# 3  
Old 07-06-2011
Please post sample input file and desire output.
# 4  
Old 07-06-2011
Java To create a .csv/excel file using shellscript

The data in notepad file and i want the products count in excel/.csv file
Navya
# 5  
Old 07-06-2011
is it assingment ?

read about the sort and uniq command. you will get the answer
# 6  
Old 07-06-2011
Code:
awk 'BEGIN{OFS=";";print "Product_name" OFS "count"}{++A[$0]}END{for(i in A) print i OFS A[i]}' input_Products.txt >output_Products.csv

The output_Products.csv can then be open in an excel sheet

Or something like
Code:
sort input_Products.txt | uniq -c | awk 'BEGIN{print "Product_name;count"}{x=$1;sub(".*"$2,$2);print $0";"x}'


Last edited by ctsgnb; 07-06-2011 at 05:05 AM..
# 7  
Old 07-06-2011
To create a .csv/excel file using shellscript

Thank u.
do we have a chance to create a excel sheet for each and every Product like,

Product_Name Count
Microsoft excel 8 ---> In one file saved as microsoftexcel.csv

Product_Name Count
.Net 8 ----> In another file called as .Net.csv
Navya
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to sort a column in excel/csv file?

I have to sort the 4th column of an excel/csv file. I tried the following command sort -u --field-separator=, --numeric-sort -k 2 -n dinesh.csv > test.csv But, it's not working. Moreover, I have to do the same for more than 30 excel/csv file. So please help me to do the same. (6 Replies)
Discussion started by: dineshkumarsrk
6 Replies

2. Shell Programming and Scripting

Compare 2 files of csv file and match column data and create a new csv file of them

Hi, I am newbie in shell script. I need your help to solve my problem. Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file. File1: SourceFile,DateTimeOriginal /home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Discussion started by: refrain
8 Replies

3. Shell Programming and Scripting

Data formatting in CSV file to EXCEL

Hello friends I want to convert an csv file on unix (which is generated by a ETL application) to a formatted excel sheet like .I have roughly like 28 columns 1)All numbers need to be stored as numbers with leading zeros-like format as text for this column to preserve leading zeroes e.g... (6 Replies)
Discussion started by: etldev
6 Replies

4. UNIX for Dummies Questions & Answers

How to Create excel file(.csv) using shell script?

Hi, i have shell script which compiles n number of test cases and execute them one by one. i want to create report in excel through script in which two columns namely "test id" and "release".second column have two subcolumns namely compiles and excutes. so i want first column should display test... (15 Replies)
Discussion started by: RamMore123
15 Replies

5. Shell Programming and Scripting

mail a csv file as an excel sheet!

Hi, The result of a script is a csv file in the following format: cat $file_name DATA_USAGE_FACT,YES_NO_FLG,TARGET_TABLE,YES_NO_FLG,1,0,15,0 DATA_USAGE_FACT,DATE_OF_CREATION,TARGET_TABLE,DATE_OF_CREATION,29,9,19,0 DATA_USAGE_FACT,UPDATION_DATE,TARGET_TABLE,UPDATION_DATE,29,9,19,0... (3 Replies)
Discussion started by: dips_ag
3 Replies

6. Shell Programming and Scripting

csv file to excel issue

Hi, I am trying to attach and email a csv file in the form of an excel sheet. And I have been successful in doing this. But after some days I realised that some fields in the csv file are also having commas because of which this field is getting splitted in columns in the excel sheet. ... (5 Replies)
Discussion started by: girish1428
5 Replies

7. UNIX for Dummies Questions & Answers

Excel File to CSV

Hi All, I have to convert the excel file which will be placed in the Unix box to a CSV file using a shell script. Please Advise. Thanks & Regards, Kumar66 (1 Reply)
Discussion started by: kumar66
1 Replies

8. Shell Programming and Scripting

How to sort columns in excel(csv) file

i want sort columns with headers based on another file headers file1 eg: i'm having an empty file with only coumn names like lastname firstname title expirydate stlcno status etc... another file with same column names and some other as well but in different order... file2 eg:firstname... (2 Replies)
Discussion started by: Man83Nagesh
2 Replies

9. UNIX for Dummies Questions & Answers

create excel file

Hi, How can I create an excel file from a txt file using shell script. Please do a help for me. Thanks, Regards, Milton (6 Replies)
Discussion started by: miltony
6 Replies

10. Shell Programming and Scripting

text file to excel or csv

Hi, I have a text file like ---------------------- aaa|bbb|ccc|ddd|eee fff|gggg|hhhhhh|kkkk -------------------- I have a script which will transfer(thourgh FTP) this text file to windows system. But I want to covert it into excel or CSF then upload into windows system.. thanks (9 Replies)
Discussion started by: srikanthus2002
9 Replies
Login or Register to Ask a Question