Exporting data as a CSV file from Unix shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Exporting data as a CSV file from Unix shell script
# 1  
Old 04-25-2010
Exporting data as a CSV file from Unix shell script

Friends...This is the first time i am trying the report generation using shell script... any suggestions are welcome.

Is there a way to set the font size & color when i am exporting the data from unix shell script as a CSV file ?

The following sample data is saved as a .csv file in the shared folder for the end user.Is there a way,i could present the header alone with different fonts/color to the end user.(FYI,the end user will access the csv file using microsoft excel)

Header:

Code:
LOCATION,ATM-ID,REPLENISHED DAY,50,100,500,TOTAL REPLENISHED,50,100,500,TOTAL DISPENSED,UTILIZATION %,50,100,500,TOTAL CASH AVAILABLE,AVAILABLE CASH %

Data:

Code:
XXXX ,12345,23/04/2010,25000,100000,250000,375000,8800,51100,90500,150400,40.11%,16200,48900,159500,224600,59.89%
YYYY ,67890,23/04/2010,25000,100000,250000,375000,2150,13100,36000,51250,13.67%,22850,86900,214000,323750,86.33%


Last edited by appu2176; 04-25-2010 at 03:05 AM.. Reason: The complete data was not provided earlier...
# 2  
Old 04-25-2010
I would do the colour formating in Excel not the shell script. If the formating and columns are always the same then record a macro in Excel to import the data and format the columns.
# 3  
Old 04-25-2010
Thanks steadyonabix ...i was just curious if it can be done through Unix shell scripting...because this can be done through C++.
I ve created a macro in XLS and is getting the output as desired.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

2. Shell Programming and Scripting

Shell script to extract data from csv file

Hi everyone, I have a csv file which has data with different heading and column names as below. Static Data Ingested ,,,,,,,,,,,,Known Explained Rejections Column_1,column_2,Column_3,Column_4,,Column_6,Column_7,,% Column_8,,Column_9 ,Column_10 ,... (14 Replies)
Discussion started by: Vivekit82
14 Replies

3. UNIX for Dummies Questions & Answers

Shell script to extract data from csv file

Hi Guys, I am new to shell script.I need your help to write a shell script. I need to write a shell script to extract data from a .csv file where columns are ',' separated. The file has 7 columns having values say column 1,column 2.....column 7 as below along with their values. Name, Address,... (7 Replies)
Discussion started by: Vivekit82
7 Replies

4. UNIX for Dummies Questions & Answers

Shell script to extract data from csv file based on certain conditions

Hi Guys, I am new to shell script.I need your help to write a shell script. I need to write a shell script to extract data from a .csv file where columns are ',' separated. The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (1 Reply)
Discussion started by: Vivekit82
1 Replies

5. Shell Programming and Scripting

Read data from .csv file through shell script & modify

I need to read data from a file called "test.csv" through shell script where the file contains values like name,price,descriptor etc. There are rows where descriptor (& in some rows name) are written as string & other characters like "car_+" OR "bike*" etc where it should contains strings like... (3 Replies)
Discussion started by: raj100
3 Replies

6. Shell Programming and Scripting

Exporting .csv file into mysql server 2005 using script.

Hi, I have a .csv file created by a script with data in a tabular format. I need to insert all the value into mysql database which is running in a different machine. what is the command to export the .csv file into database using shell script. Thanks in advance. (3 Replies)
Discussion started by: ahamed
3 Replies

7. Shell Programming and Scripting

exporting number into .csv file in text form (no other extra charc) from shell script

I have written a k shell program which is executing a sql and exporting data in numeric form like 0412323444 into .csv file. the problem i am facing is that , the data is coming in excel formatted in scientific form like 4.1+E08,while my requirement is to store data as such 0412323444 in excel ( no... (5 Replies)
Discussion started by: Deepak_Rastogi
5 Replies

8. Shell Programming and Scripting

Shell Script to Load data into the database using a .csv file and .ctl file

Since i'm new to scripting i'm findind it difficult to code a script. The script has to be an executable with 2 paramters passed to it.The Parameters are 1. The Control file name(.ctl file) 2. The Data file name(.csv file) Does anybody have an idea about it? :confused: (3 Replies)
Discussion started by: Csmani
3 Replies

9. Shell Programming and Scripting

Exporting text file data to csv

Could any one help me in basic shell script to export text file data to csv. I need to export only particular data from text file to csv column. I am a newbie to UNIX could anyone help me with sample script code (3 Replies)
Discussion started by: l_jayakumar
3 Replies

10. Shell Programming and Scripting

unix script to export data from csv file to oracle database

Hello people, Need favour. The problem I have is that, I need to develop a unix shell script that performs recurring exports of data from a csv file to an oracle database. Basically, the csv file contains just the first name and last name will be dumped to an Unix server. The data from these... (3 Replies)
Discussion started by: vinayagan
3 Replies
Login or Register to Ask a Question