Creating CSV files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating CSV files
# 1  
Old 04-20-2010
Data Creating CSV files

hi,

Need a lil help experts.
i have a sh file and its calling one SQL file.
i need the dataset returned by that SQL file in a CSV format.
Can you plz help me out at the earliest.

waiting eagerly .. Smilie

Thanks..
# 2  
Old 04-20-2010
Hi
Could you please tell a little more about the current SQL output you are getting?

Thanks
Guru.
# 3  
Old 04-20-2010
What is the format of the SQL file? How is it created? Are you extracting the data from a database or are you just prepping the data for insertion into a database?
# 4  
Old 04-21-2010
Hi Guru/Dday,

the sql file fetches the data from a database(oracle 9i.
approx 20000 records with 10 columns.
Its only a select statement.
I am suppossed to dumb the data in CSV format and pass on to lower system.

thnnks
# 5  
Old 04-21-2010
Try...
Code:
select column1 || ',' || column2 || ',' || column3  || ',' || column4 ...

# 6  
Old 04-21-2010
Ygor,

its the most common way but the problem is that i can't touch the sql file
as that belongs to another vendor.Appending ',' is not possible infact i can't edit the SQL.
I can only call the SQL and any manipulation needed to be done for making CSV i have to do in UNIX area itself.

please suggest.
# 7  
Old 04-21-2010
Quote:
Originally Posted by onlyniladri
Ygor,

its the most common way but the problem is that i can't touch the sql file
as that belongs to another vendor.Appending ',' is not possible infact i can't edit the SQL.
I can only call the SQL and any manipulation needed to be done for making CSV i have to do in UNIX area itself.

please suggest.
As already requested by other members too, why don't you show how the file looks like so you can get a better help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Match columns from two csv files and update field in one of the csv file

Hi, I have a file of csv data, which looks like this: file1: 1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628 2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Discussion started by: djoseph
10 Replies

2. UNIX for Dummies Questions & Answers

Creating a csv file with header in UNIX

I have a flat file that contains dynamic list of variables like a=1 b=2 c=3 . .. z=26 I need to convert the above into a csv file having the format below: a,b,c,..,z 1,2,3,..,26 Please note, I do not want a comma separating the last variable. I tried to refer the post... (4 Replies)
Discussion started by: vkumbhakarna
4 Replies

3. UNIX for Dummies Questions & Answers

Problem in creating CSV file

Hi guys, I am not experienced with Unix, so please dont mind if the question seem to be irrelevant. I have written a simple script, that connects DB & fetches few records from a table. I wanted to get those details as file in .CSV format via mail. -I stored the query o/p in a file. -I... (6 Replies)
Discussion started by: sumitburnwal88
6 Replies

4. Shell Programming and Scripting

creating a csv file from this 1 liner?

I'm trying to create a csv file by running awk and sed on a number of xml files in a directory; I'm using this below: hostname; grep "BuildDate" /dir/ABCD/configuration/*/*.xml | awk -F"/" '{ print $5 }' > /tmp/tempfile.txt; grep "BuildDate" /dir/ABCD/configuration/*/*.xml | awk -F\" '{ print $2... (2 Replies)
Discussion started by: rich@ardz
2 Replies

5. UNIX for Dummies Questions & Answers

Creating a report from csv file.

Hi Gurus, I need your help in transforming the CSV file into some what a report format. My source file looks like below Date,ProdID,TimeID,LevelID 2010-08-31,200,M,1 2010-08-31,201,Q,2 2010-08-31,202,Y,1 2010-08-31,203,M,5 Output required is ... (9 Replies)
Discussion started by: naveen.kuppili
9 Replies

6. UNIX for Dummies Questions & Answers

creating a CSV file for past 7 days

I have a requirement which will select the files with a specific naming convention which got created in past 7 days in a specific directory.Lets say the directory is /data/XYZ and the file names follow the below nomenclature like Daily_File*.txt I just need to create one CSV file which will... (12 Replies)
Discussion started by: dr46014
12 Replies

7. UNIX for Dummies Questions & Answers

Creating CSV Files

I have a requiremnt to create one CSV file with initial 5 lines as blank rows. From 5th row onwards the file is to be created from a list of varibales which gets evaluated. Say A,B,C,D,E are 5 varibales with some value associated with each of them and data type is string. So the 6th row should... (1 Reply)
Discussion started by: dr46014
1 Replies

8. UNIX for Advanced & Expert Users

Creating multiple worksheets in CSV file

Hello, I've been tasked with sending 3 types of data (file size, row count, and file name) to a csv file every month for various vendors. I have been asked to put this in one csv or xls file with each vendor being a different tab (or worksheet). Until now, we have been finding and emailing... (4 Replies)
Discussion started by: tekster757
4 Replies

9. Shell Programming and Scripting

creating a csv file in awk

Hi All I am trying to create a csv file in the korn shell and the script segment is as follows: if then # NEED TO ADD INFO TO THE EMAIL FILE ABOUT THE DRIVE THAT'S FILLING UP echo "$drive $percent% $space "|\ awk '{printf("%d/t"|"%d/t"|"%d/t\n",... (6 Replies)
Discussion started by: Segwar
6 Replies

10. Shell Programming and Scripting

help!!!!!! in creating csv report

Dear All, I need the help of all the genius minds to find solution to my problem. This problem has left me in a situation like I am in middle of sea with a rubber boat , so please help me out to get out of this. Problem:-- I m using the informix database with installed on linux machine and... (6 Replies)
Discussion started by: xander
6 Replies
Login or Register to Ask a Question