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?
# 8  
Old 10-09-2013
testfile is your attached sample: scripttextfile.txt
# 9  
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
I tried above code and redirected to .csv file(see the output.csv) it not creating columns with their names. not coiming in separate columns also ; is printed in .csv file.

required .csv file is attached for your reference.
# 10  
Old 10-09-2013
That is no csv file but xls.
Are you sure that you're on a linux or unix system?
# 11  
Old 10-09-2013
Talking straight: What in here
Code:
B_019.config : PASSED
B_001.config : PASSED
B_002.config : PASSED
B_003.config : PASSED
B_004.config : FAILED
B_056.config : PASSED

do you want to go where
Code:
?   ?   ?   ?

?

I can see TWO columns; no release info, no compile/execute info. Unless you give us clear info, we won't be able to help you.
# 12  
Old 10-09-2013
Quote:
Originally Posted by sea
That is no csv file but xls.
Are you sure that you're on a linux or unix system?
Hi,
i am on linux only. here i cant attach .csv file so i converted that file to xls only for attachment purpose.

Thanks
# 13  
Old 10-09-2013
Rather rename it to txt.. (from csv, NOT from xls)
# 14  
Old 10-09-2013
Quote:
Originally Posted by RudiC
Talking straight: What in here
Code:
B_019.config : PASSED
B_001.config : PASSED
B_002.config : PASSED
B_003.config : PASSED
B_004.config : FAILED
B_056.config : PASSED

do you want to go where
Code:
?   ?   ?   ?

?

I can see TWO columns; no release info, no compile/execute info. Unless you give us clear info, we won't be able to help you.
Thanks for your reply.

my original script generates text file like:
Code:
B_019.config FR2.0 COMPILE_PASSED TEST_PASSED
B_020.config FR2.0 COMPILE_PASSED TEST_PASSED
B_021.config FR2.0 COMPILE_PASSED TEST_PASSED
B_022.config FR2.0 COMPILE_PASSED TEST_PASSED

i just want it to be displayed in .csv file
Code:
testid          release compilestatus     executestatus
B_019.config FR2.0 COMPILE_PASSED TEST_PASSED
B_020.config FR2.0 COMPILE_PASSED TEST_PASSED
B_021.config FR2.0 COMPILE_PASSED TEST_PASSED
B_022.config FR2.0 COMPILE_PASSED TEST_PASSED


Last edited by Franklin52; 10-09-2013 at 11:05 AM.. Reason: Please use code tags
 
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