LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-18-2014, 03:37 AM   #1
mierdatuti
Member
 
Registered: Aug 2008
Posts: 54

Rep: Reputation: 15
tabulated query with shell script


Hi,
I have a query and I'm trying to show the rows in a readable format but don't works. It seems that don't works rpad and trim function.
Could you help me please?
Code:
select trim(rpad(SCHED_TABLE,20,'x')) TABLA, trim(rpad(JOB_NAME,30,'x')) .....
Shows me the output:
Code:
DWHRECPE_22x





















                   34234324234xxxxxxxxx
 
Old 07-20-2014, 12:48 AM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
bash-4.3$ cat > test.txt << EOF
The more you tell us the better we can help you. The
more you tell us the better we can help you. The more
you tell us the better we can help you. The more you
tell us the better we can help you. The more you tell
us the better we can help you. The more you tell us
the better we can help you. The more you tell us the
better we can help you. The more you tell us the better
we can help you. The more you tells us the better we can
help you. The more you tell us the better we can help
you
EOF

bash-4.3$ awk '{print $1"\t "$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12}' test.txt
You mean like that?

Last edited by dijetlo; 07-20-2014 at 12:49 AM. Reason: Formatting didn't transfer
 
Old 07-23-2014, 05:49 AM   #3
mierdatuti
Member
 
Registered: Aug 2008
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks,
My question is why if I make a rpad in the query, shows me a lot of spaces
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Query on shell script manickaraja Linux - Newbie 2 08-15-2013 09:46 PM
Shell script query - How do I achieve the results manya Programming 4 02-07-2010 02:23 AM
msyql query from shell script hamish Linux - Software 5 06-02-2006 10:06 AM
Simple shell script query sachinh Programming 5 09-07-2005 05:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration