- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Export table data to flat file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 06:57 AM
тАО12-13-2007 06:57 AM
I have an oracle db installed in a unix system. I want the table data to be exported to a flat file.The fields in the flat file need to be "PIPE separated".
Please let me know how to go about using bash shells. I have tried the reverse procedure (sql loaders).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 07:03 AM
тАО12-13-2007 07:03 AM
Re: Export table data to flat file
Well, if you already have whitespace (spaces and tab) delimited data, simply do:
# perl -nale 'print join "|",@F' file
Regards!
...JRF...
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 07:06 AM
тАО12-13-2007 07:06 AM
Re: Export table data to flat file
Hi,
Thanks for your reply,that was very fast. I am not so well versed in perl,can you explain this using bash scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 07:08 AM
тАО12-13-2007 07:08 AM
Re: Export table data to flat file
http://asktom.oracle.com/tkyte/flat/index.html
http://www.withdata.com/oracmd_unload.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 07:11 AM
тАО12-13-2007 07:11 AM
Re: Export table data to flat file
Well, in Perl, this reads your input file ('-n') and automatically splits each record into whitespace-delimited fields ('-a') into an array called '@F'. The fields of @F are then printed using the 'join' operator and a pipe delimiter. The '-l' switch adds a newline to each record as it is printed.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 07:22 AM
тАО12-13-2007 07:22 AM
Solutionthis might help:
http://www.orafaq.com/faqloadr.htm#UNLOAD
but you may have to substitute
select col1 || ',' || col2 || ',' || col3
with
select col1 || '|' || col2 || '|' || col3
to get a pipe-delimited result.
Regards
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 11:46 AM
тАО12-13-2007 11:46 AM
Re: Export table data to flat file
Check following url
http://www.oracle-bse.com/articles/9i/GeneratingCSVFiles.php
utl_file is excellent for this issue.
Best Regards
Murat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2007 03:53 AM
тАО12-31-2007 03:53 AM
Re: Export table data to flat file
Thanks my is Problem solved -used the utl package in plsql
Thanks,
Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2007 10:31 PM
тАО12-31-2007 10:31 PM