Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > sql result to csv or excel file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-22-07, 02:11
tiger66 tiger66 is offline
Registered User
 
Join Date: Dec 2007
Posts: 24
sql result to csv or excel file

Hi
I need some help from an expert in sybase and shell script.
Does anyone know how to save the data from a sql to a csv or excel file using shell script?

I can only save the data to a txt file. The problem is that the data in the file are not very readable. So, I want to save the data in a csv or excel file

the shell script I have is:

sql_file="sqls.sql"
output="out.txt"
`isql -U ${USER} -P ${PWD} -D ${DB} -S ${SEVER} -i $sql_file -o $output`

If you can help, please let me know. I will be really appreciated

Thanks
Reply With Quote
  #2 (permalink)  
Old 12-28-07, 16:56
PMASchmed PMASchmed is offline
Registered User
 
Join Date: Jun 2004
Location: Long Island
Posts: 400
We need to know what the contents are of sqls.sql, this is the important part.

I imagine it would be select col1 + ',' + col2 + ',' + col2 + ',' or something of this nature.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On