LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2006, 08:58 AM   #1
qrshat
Member
 
Registered: Oct 2005
Posts: 56

Rep: Reputation: 15
control the view of a file


hi,

i want to change the view of the my output in my script. My output file look like as

dbase1 @tosba-2
dbase2 @tosba
dbase3 @172.31.
dbonline @172.31.
dbase17 @172.21.
tosba2 @tosba-2
tosba3 @tosba-2
alpha1200 @172.21.
dbTHQR84 @172.31.




but i want to it looks like as

dbase1 @tosba-2
dbase2 @tosba
dbase3 @172.31.
dbonline @172.31.
dbase17 @172.21.
tosba2 @tosba-2
tosba3 @tosba-2


is there a simple way to perform this.

Thanks
 
Old 02-17-2006, 09:06 AM   #2
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
how are you getting the output?

grep??
 
Old 02-17-2006, 09:15 AM   #3
kshkid
Member
 
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383

Rep: Reputation: 30
are you grep -ing for all the entries except alpha and dbTH
(or)
just stripping the last two entries

could you please explain?
 
Old 02-17-2006, 09:25 AM   #4
qrshat
Member
 
Registered: Oct 2005
Posts: 56

Original Poster
Rep: Reputation: 15
the problem isn't the result of the output. The problem is the view of the output. I've get a problem with the tab charecter.

i'm using

for ...

do
echo "$value1\t\t$value2\t\t$value3" >>myfile
.
.
.
done

but the view of myfile is't look like as i expect. when i look the file with more or vi,the file looks like as follow

Value Value2 value3
valued value value
valuefdaf value valuefafa

but i want it to looks like as follow
Value value2 value3
valued value value
valuefdaf value valuefafa


thanks.
 
Old 02-17-2006, 09:29 AM   #5
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
Quote:
Value Value2 value3
valued value value
valuefdaf value valuefafa

but i want it to looks like as follow
Value value2 value3
valued value value
valuefdaf value valuefafa
this is the same!

if you want to show something like that enclose it in quotes.
 
Old 02-17-2006, 09:47 AM   #6
qrshat
Member
 
Registered: Oct 2005
Posts: 56

Original Poster
Rep: Reputation: 15
yes the same.

but i found how i explain. just thinking there is no the .(dot) charecter between value.

the view of the result.

Value....Value2.......... value3
valued.....value............ value
valuefdaf...... value......... valuefafa



the view, i want to create.

Value......Value2........value3
valued.....value.........value
valuefdaf..value.........valuefafa
 
Old 02-17-2006, 11:44 AM   #7
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i had a previous post like this in 'c':

http://www.linuxquestions.org/questi...ghlight=column
 
Old 02-18-2006, 10:48 AM   #8
qrshat
Member
 
Registered: Oct 2005
Posts: 56

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by schneidz
i had a previous post like this in 'c':

http://www.linuxquestions.org/questi...ghlight=column

yes! exactly what i want to. thanks for your kind.
 
Old 02-18-2006, 02:24 PM   #9
qrshat
Member
 
Registered: Oct 2005
Posts: 56

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by schneidz
i had a previous post like this in 'c':

http://www.linuxquestions.org/questi...ghlight=column

yes! exactly what i want to. thanks for your kind.

how i use this c code in shell script. is there any way for it?
 
  


Reply



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
Can't view print.ps file tooparam Linux - Software 2 01-31-2006 11:38 AM
How do you view a file on a floppy Charlie Chan Linux - Newbie 5 01-29-2006 11:26 AM
how do I view .pqf and .shw file Robert Benkhe Linux - Software 1 06-29-2005 08:50 PM
how to view this file?? yenonn Linux - General 4 04-28-2004 02:26 AM
can't view file in konsole inTUXicated Linux - Newbie 2 08-06-2003 07:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:26 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
Open Source Consulting | Domain Registration