Sponsored Content
Full Discussion: Export table of 50 columns
Top Forums Shell Programming and Scripting Export table of 50 columns Post 302638397 by brianjb on Thursday 10th of May 2012 08:37:40 AM
Old 05-10-2012
Add this to the end:

Code:
awk '{print$1","$2","$3","$4","$5","$6","$7","$8","$9","$10","$11","$12","$13","$14","$15","$16","$17","$18$","$19","$20","$21","$22","$23","$24","$25","$26}'

Notice that there are double quotes around each comma. That is telling awk to print what is in the double quotes. Then the $ means to print that number of field.

---------- Post updated at 07:37 AM ---------- Previous update was at 07:34 AM ----------

aawt,

If you do this:

Code:
I modify and use select * and it export only 2 columns

That should export every column in that table.

Do this command:

Code:
mysql -u username -ppassword instancename -e "show columns from tablename"

where the tablename is the name of the table that you only got two columns exported. It is possible that you are trying to export the wrong table.
This User Gave Thanks to brianjb For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

export table from oracle database

i would like to export a particular table in my oracle database installed in a hpux box. i would like to determine the filesize of the output before performing these action so i can assess if my harddisk can still handle it. thanks as usuall :rolleyes: (1 Reply)
Discussion started by: inquirer
1 Replies

2. Shell Programming and Scripting

help for writing shell script to export table data

Hi All, I need to write a shell script(ksh) to take the tables backup in oracle(exporting tables data). The tables list is not static, and those are selecting through dynamic sql query. Can any body help how to write this shell script. Thanks, (3 Replies)
Discussion started by: sankarg
3 Replies

3. Shell Programming and Scripting

Export a HTML table to Xcel

Hello All, I have a perl script that prints a HMTL table. I want to convert this data into a report and this want to export this information into Excel. How can I do this? Regards, garric (3 Replies)
Discussion started by: garric
3 Replies

4. Shell Programming and Scripting

Problem in scheduling an Export of a table

Hi, I am facing a problem while scheduling an export of a table using cron job. I have written a simple export command inside a shell script test.sh like echo started exp schemaname/temp1234 file= /test/d.dmp tables=per_st log= /test/d.log echo ended I tried scheduling it through... (6 Replies)
Discussion started by: beautifulmind
6 Replies

5. Shell Programming and Scripting

How to export table data to xml file?

Hi , I would like to get some suggestion from the experts. My requirement is to export oracle table data as an xml file. Any unix/linux tools, scripts available? Regards, (2 Replies)
Discussion started by: LinuxLearner
2 Replies

6. Shell Programming and Scripting

Shell script to export data from Oracle table .

Hi, I want to write a shell script which will export data from oracle table . I don't want to save that data . I want the queries . Right now i am right clicking on the table and clicking on export as to my desktop . Please let me know if any one have any idea . (2 Replies)
Discussion started by: honey26
2 Replies

7. Shell Programming and Scripting

Export table and restart from last table

Hello all, Thank you in advance for reading my post and helping me.. Scenario: I have 50 tables whose names are in a file export.sql, i use the below command to export all these tables one by one cat export.sql|while read tn do echo "export to $tn.del of del select from... (7 Replies)
Discussion started by: family_guy
7 Replies

8. Shell Programming and Scripting

How to export hive table data to a file on local UNIX?

Hi All , I am stuck on the below situation.I have a table called "test" which are created on hive.I need to export the data from hive to a file(test.txt) on local unix system.I have tried the below command ,but its giving the exception . hive -e "select * from test " > /home/user/test.txt ; ... (1 Reply)
Discussion started by: STCET22
1 Replies

9. UNIX for Advanced & Expert Users

How can i export entries from table into a variable and parse them?

Hi, I need to export some entries from a table, from a specific column and then redirect them into a file. I used sql plus, in order to fetch the entries and i put them in one variable. When i am running the script it stuck at a point and does not move further. I did something like: ... (4 Replies)
Discussion started by: cookie2
4 Replies

10. UNIX for Beginners Questions & Answers

Export HTML table

HI , I have a HTML tables as below. It has 2 tables ,I want to extract the second table . Please help me in doing it. <html> <body> <b><br>Running Date: </b>11-JAN-2019 03:07</br> <h2> Schema mapping and info </h2> <BR><TABLE width="100%" class="x1h" cellpadding="1"... (3 Replies)
Discussion started by: deepti01
3 Replies
SHTOOL-TABLE.TMP(1)					      GNU Portable Shell Tool					       SHTOOL-TABLE.TMP(1)

NAME
shtool-table - GNU shtool pretty-print a field-separated list SYNOPSIS
shtool table [-F|--field-sep sep] [-w|--width width] [-c|--columns cols] [-s|--strip strip] strsepstr... DESCRIPTION
This pretty-prints a list of strings as a table. OPTIONS
The following command line options are available. -F, --field-sep sep Separate columns using sep. Default is ":". -w, --width width Width of each column. Default is 15 characters. -c, --columns cols Number of columns. Default is 3. -s, --strip strip Strip off any characters past strip. Default is 79. EXAMPLE
# shell script shtool table -F , -w 5 -c 4 "1,2,3,4,5,6,7,8,9,10,11,12" HISTORY
The GNU shtool table command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1999 for GNU shtool. SEE ALSO
shtool(1), tr(1), fmt(1), sh(1), awk(1), sed(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-TABLE.TMP(1)
All times are GMT -4. The time now is 10:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy