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


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to Create excel file(.csv) using shell script?
# 1  
Old 10-08-2013
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 id and in next two sub columns it should display YES or NO depending on the result of compilation and execution(PASSED or FAILED).

currently i am generating one text file from script only which shows test id and result of test cases.

i have attached both files current test result required excel format.

Please help me in this. Thanks!!!
# 2  
Old 10-08-2013
we can make excel format simple

we can make excel format simple like just making 4 columns..

"test id" "Release" "Compile" "Execute"
B_001.config FR1.1 Yes PASSED


so here first n last column we can take from text file that i have already created. second and third columns vales are same for all rows.

now anybody can suggest how to do this.
# 3  
Old 10-08-2013
Your scriptfile has info about one single action only; it is not clear to which this is related, compilation or execution. And, in a .csv file you can't have subcolumns, so it will be three columns in total, once the action can be identified.
This User Gave Thanks to RudiC For This Post:
# 4  
Old 10-09-2013
Quote:
Originally Posted by RudiC
Your scriptfile has info about one single action only; it is not clear to which this is related, compilation or execution. And, in a .csv file you can't have subcolumns, so it will be three columns in total, once the action can be identified.
in my script three variables can give us input for each column...
1st column) "$i" which is test case name with id...
2nd column) "FRRELEASE" which is user input from command prompt
3nd column) "errstat" which can give compile status i.e. $?
4th columns) "RESULT" which gives execution result i.e. $PIPESTATUS[0]

so we have to create four columns as i have mentioned in second post. then wee need to pass all above listed values in each row.

no need to take input from text file.

hope you will get my purpose.
# 5  
Old 10-09-2013
Assuming there are no spaces in the values itself Smilie
Code:
while IFS=' ' read testid release compile execute;do echo "$testid ; $release ; $compile ; $execute";done<testfile

(this is my first IFS attempt)

Hope this helps
# 6  
Old 10-09-2013
Quote:
Originally Posted by sea
Assuming there are no spaces in the values itself Smilie
Code:
while IFS=' ' read testid release compile execute;do echo "$testid ; $release ; $compile ; $execute";done<testfile

(this is my first IFS attempt)

Hope this helps
hi,
testfile doesnot conatin any name like testid release compile execute.
i want these should be columns name in .csv file . after reading txtfile row by row it shouls print those vanlues in columns.

it will work??
# 7  
Old 10-09-2013
If you dont understand the code submitted to you, you should not post here, this is for solving and helping people with the shellscript they submitted... moving to dummies...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

awk and sed script to create one output CSV file

Hi All , I would require your help to generate one output file after post processing of one CSV file as stated below This file is just a small cut from a big file . Big file is having 20000 lines PATTERN,pat0,pat1,pat2,pat3,pat4,pat5,pat6,pat7,pat8,pat9... (2 Replies)
Discussion started by: kshitij
2 Replies

2. Shell Programming and Scripting

Tabbed multiple csv files into one single excel file with using shell script not perl

Hi Experts, I am querying backup status results for multiple databases and getting each and every database result in one csv file. so i need to combine all csv files in one excel file with separate tabs. I am not familiar with perl script so i am using shell script. Could anyone please... (4 Replies)
Discussion started by: ramakrk2
4 Replies

3. Shell Programming and Scripting

Create excel file using bash script

i have written one script which generates text file which gives output like. 001.config: CR1.1 COMPILE_PASSED TEST_PASSED 002.config: CR1.1 COMPILE_FAILED TEST_FAILED . . .so on this text file will get filled one by one as its for loop for n number. i... (7 Replies)
Discussion started by: RamMore123
7 Replies

4. Shell Programming and Scripting

Script to create a CSV file

I created a script that will go out and so a "/sbin/chkconfig --list | egrep XXX" against a server list that would create an output file like the following example: ---------------------------------------------------------------------------------- SERVER1 RC_Script_1 0:off 1:off 2:off... (4 Replies)
Discussion started by: asnatlas
4 Replies

5. Shell Programming and Scripting

Shell Script for converting file to Excel or CSV

Hi I have a dat file which has "n" number of columns. The file is delimited. The number of columns keep varying as the file is generated out of DB queries. Could you please help me in writing a script which will generate a XLS or CSV file out of the dat file. (5 Replies)
Discussion started by: Vee
5 Replies

6. Shell Programming and Scripting

How to create multiline csv cell through shell script?

Hi, I have a text like the one given below status="Observation 1" read1="Source rows not load" read2="Score drop" I want to create a csv and mail it out in such a way that all three lines will be in a single cell but as three lines. For ex Col C1 ... (3 Replies)
Discussion started by: prasperl
3 Replies

7. Shell Programming and Scripting

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. (12 Replies)
Discussion started by: Navya
12 Replies

8. Shell Programming and Scripting

Shell script - Excel/CSV file - More than one tab

Hi All, Following is my requirement. I have searched the site and found some threads which has same queries, but non of them have any answer. I thought of posting it once more. We are generating different reports through shell script after we finish our data load. Currently there are 7 such... (5 Replies)
Discussion started by: ace_friends22
5 Replies

9. Shell Programming and Scripting

how to create csv file using shell script

I have a file in multiple directory which has some records in the following format File: a/latest.txt , b/latest.txt, c/latest.txt -> Name=Jhon Age=27 Gender=M Street=LA Road Occupation=Service I want to generate a csv file from the above file as follows File: output.csv -> ... (9 Replies)
Discussion started by: rjk2504
9 Replies

10. Shell Programming and Scripting

How to convert a excel file to a .csv file from unix script

Hi I have a excel file in unix machine and have to convert it into a .csv file.I have to do this from a unix script.How do we do this? Thanks Abhinav (3 Replies)
Discussion started by: akashtcs
3 Replies
Login or Register to Ask a Question