Sponsored Content
Full Discussion: Oracle to CSV to XLS
Top Forums Shell Programming and Scripting Oracle to CSV to XLS Post 302568866 by felipe.vinturin on Friday 28th of October 2011 12:39:41 PM
Old 10-28-2011
As Peasant commented, Windows associates CSV extension to Excel (by default), so Excel will open it.

To extract the data we have some options:
Code:
# File_1.sql - Using COLSEP
SET LINESIZE 700 -- This may change, depends on your output line size
SET PAGESIZE 0
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET COLSEP ","
-- Example query
Select 1,
         2
From Dual;

# File_2.sql - Using "CONCAT"
SET LINESIZE 700 -- This may change, depends on your output line size
SET PAGESIZE 0
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
-- Example query
Select 1 || ',' ||
         2
From Dual;

Just one more comment, be sure that there are no "," in the fields you are extracting, otherwise you may face problems or, in every field you extract, you can use the Oracle REPLACE function:
Code:
REPLACE(TABLE_COLUMN, ',', ' ')

I hope it helps!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting csv to xls

Hi, Can anyone tell the option to change the file type in unix. i.e. if a file is in csv(Comma Separating Values) format, it should be changed to xls(ordinary MS-Excel) format. But renaming command is not changing to correct file format. Thanks in advance, Milton. (1 Reply)
Discussion started by: miltony
1 Replies

2. Shell Programming and Scripting

From xls to csv file

Can we convert an xls file into csv format in Unix Thanks Suresh (1 Reply)
Discussion started by: sureshg_sampat
1 Replies

3. Shell Programming and Scripting

.xls to .csv conversion

Hi Please can someone tell me how i can convert .xls file into .csv on both platforms, windows and unix. many thanks, neil (4 Replies)
Discussion started by: neil546
4 Replies

4. UNIX for Dummies Questions & Answers

WINDOWS to UNIX : xls to csv

Hi, I need to ftp a .xls file from WINDOWS to UNIX. When I do it, the file coversion doesn't happen(??) or UNIX doesn't recognixe this format I know not. But there will be junk values in the ftp'd file. Note: The ftp will be done by a script and I don't think we could place a WINDOWS script on... (5 Replies)
Discussion started by: preethgideon
5 Replies

5. Shell Programming and Scripting

xls to csv

how to convert a xls file into .csv file? is tghere any command in unix for that? please help thanks (3 Replies)
Discussion started by: infyanurag
3 Replies

6. Shell Programming and Scripting

converting xls file to txt file and xls to csv

I need to convert an excel file into a text file and an excel file into a CSV file.. any code to do that is appreciated thanks (6 Replies)
Discussion started by: bandar007
6 Replies

7. Shell Programming and Scripting

how to convert .xls to .csv

Hi, I have problem..How to convert .xls file to .csv.. Plz help me for this problem.. (1 Reply)
Discussion started by: varma457
1 Replies

8. Shell Programming and Scripting

CSV to XLS

Ok, every morning at my office we send out excel sheets to Economy people with statistics for yesterdays trading. All the trading run's in Redhat or Solaris environments. We run a script on a Redhat server whitch generates the stats in CSV format. After we download we open it in Excel and... (3 Replies)
Discussion started by: chipmunken
3 Replies

9. Shell Programming and Scripting

csv to xls : missing rows

A unix script generates a file "1.csv". I use the following to email this as an excel sheet. /usr/bin/uuencode /tmp/1.csv 1.csv > $PATH/attachment.txt mailx -r abc@domain.com -s "Subject" myself@domain.com < $PATH/attachment.txtI get the file as CSV in the email and everything is fine except... (9 Replies)
Discussion started by: girish1428
9 Replies

10. Shell Programming and Scripting

Csv to xls

Hello I have a script which converts log to csv. Now I need to have xls. Is there any easy way/command which can convert csv to xls?:confused: preferably just using bash and not perl,... is it possible? (1 Reply)
Discussion started by: frhling
1 Replies
RESET(7)						  PostgreSQL 9.2.7 Documentation						  RESET(7)

NAME
RESET - restore the value of a run-time parameter to the default value SYNOPSIS
RESET configuration_parameter RESET ALL DESCRIPTION
RESET restores run-time parameters to their default values. RESET is an alternative spelling for SET configuration_parameter TO DEFAULT Refer to SET(7) for details. The default value is defined as the value that the parameter would have had, if no SET had ever been issued for it in the current session. The actual source of this value might be a compiled-in default, the configuration file, command-line options, or per-database or per-user default settings. This is subtly different from defining it as "the value that the parameter had at session start", because if the value came from the configuration file, it will be reset to whatever is specified by the configuration file now. See Chapter 18, Server Configuration, in the documentation for details. The transactional behavior of RESET is the same as SET: its effects will be undone by transaction rollback. PARAMETERS
configuration_parameter Name of a settable run-time parameter. Available parameters are documented in Chapter 18, Server Configuration, in the documentation and on the SET(7) reference page. ALL Resets all settable run-time parameters to default values. EXAMPLES
Set the timezone configuration variable to its default value: RESET timezone; COMPATIBILITY
RESET is a PostgreSQL extension. SEE ALSO
SET(7), SHOW(7) PostgreSQL 9.2.7 2014-02-17 RESET(7)
All times are GMT -4. The time now is 09:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy