Screen Output to Specific Columns


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Screen Output to Specific Columns
# 1  
Old 08-04-2010
Screen Output to Specific Columns

User with moderate experience:

I run a script (my addiction is KSH) that reads a file and reports certain parameters back to the user on screen and also piped to a file. The file(s) I read is/are located under different directories, and is usually called the same thing. Sometimes not. For example:

a/b/c/casefile
this/too/is/casefile_here

When I report (print out) the different parameters back, I also am reporting the location the file is in... but this can make for a disjointed output that might look something like this:

a; b; c; casefile - 1 digit, 3 digits, 9 acme bombs
this; too; is; casefile_here - 3 digit, 9 digits, 1 acme bomb

I would like to be able to have the printout look more like this:


a; b; c; casefile -______________1 digit, 3 digits, 9 acme bombs
this; too; is; casefile_here -_____ 3 digit, 9 digits, 1 acme bomb

(SANS the "_'s"! I had to add those to line up the right section. doh!)

This is for ease of review of the column data in the right section.

I've tried various tab ideas but the length of the first (left) section of output dictates where the tabbing starts and does not line up my text in the right section in a nice, symmetrical pattern.

I'm not catching what it is I need to do, nor have I hit upon the right search term here on UNIX.COM to find what I'm looking for. (As the last hour or so can attest to.)

Any links or ideas would be welcomed that would help resolve my perplexity. "Thank you kindly!"

-Bruce
# 2  
Old 08-04-2010
man printf
# 3  
Old 08-04-2010
so I'll be able to print specific variables at specific columns with printf? Like putting the "digit" output at column 40 from the left? That would be cool. I thought I tried printf last week, but I'll take a 2nd gander. Thanks.
# 4  
Old 08-09-2010
Quote:
Originally Posted by jpradley
man printf
Thanks bud... by your pointing this out forced me to review the function a lot more carefully than I originally did and I got it working.

Appreciate it!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Byobu specific screen size.

There is away to make a window pane a specific size. I just forgot how to do it. Something like this: Ctrl-A : split-window -l xx -h xx Anyone know the right way to do this? Thanks. (1 Reply)
Discussion started by: ignatius
1 Replies

2. UNIX for Beginners Questions & Answers

Screen output to a file

Hi All, I am trying to out of shell script when i run it like sh /mypath/abc.sh ....a screen log should be generated whenever i input the values, when above the script prompt for values Regards Amarendra (3 Replies)
Discussion started by: amar1208
3 Replies

3. UNIX for Dummies Questions & Answers

Printing lines with specific strings at specific columns

Hi I have a file which is tab-delimited. Now, I'd like to print the lines which have "chr6" string in both first and second columns. Could anybody help? (3 Replies)
Discussion started by: a_bahreini
3 Replies

4. Shell Programming and Scripting

Clear specific part of the screen

I want to clear specific part of the screen. Say for example , i am running a bash script for i in {1..100} do echo "Current Record = $i" done if i use a clear command over there , it will clear my screen however when i scroll up i would have the old records , is there anyway in unix to... (5 Replies)
Discussion started by: chidori
5 Replies

5. Shell Programming and Scripting

Can't figure out how to find specific characters in specific columns

I am trying to find a specific set of characters in a long file. I only want to find the characters in column 265 for 4 bytes. Is there a search for that? I tried cut but couldn't get it to work. Ex. I want to find '9999' in column 265 for 4 bytes. If it is in there, I want it to print... (12 Replies)
Discussion started by: Drenhead
12 Replies

6. Shell Programming and Scripting

Screen output

Is it possible to split the screen and show, lets say a local directory listing on the left and a remote directory listing on the right with shell scripting? I know it's usually done with curses/ncurses, but I'd really like to keep it simple as possible. I guess 'dialog' command could do it... (1 Reply)
Discussion started by: lochraven
1 Replies

7. UNIX for Advanced & Expert Users

how to force output to screen??

hi, is there anyway i can force a output of a command to the monitor. for example banner hello > /dev/console it will show a hello in the console, so how do i make it to appear on the monitor screen when the console is been minmize. (6 Replies)
Discussion started by: ckng
6 Replies

8. UNIX for Dummies Questions & Answers

no screen output

I'm a newbie. I'm having a problem at work with a script. What i'm trying to do is connect to a cisco switch from a sun station. After i run the script and telnet into the switch i don't get any output on the "xterm window" and all my commands from the script don't show up on the screen or on... (0 Replies)
Discussion started by: wisher115
0 Replies

9. Shell Programming and Scripting

Turn off Screen Output

Is there a way to turn off standard output while processing is going on? I have tried redirecting to /dev/null but that is not working because some of the commands invoke a profile. I would like to temporarily turn off the screen output until the processing is complete. Sort of like a splash... (3 Replies)
Discussion started by: bestbuyernc
3 Replies

10. Shell Programming and Scripting

screen output

I need to put the following in a script: echo $CCPDB will give me the db name on the screen. I need to use this name to tar cvfEh <newtarname> <dbname.exp>. I am not sure how to use the output that display on the screen in a script. I tried this echo $CCPDB > file didn't work Gundu (1 Reply)
Discussion started by: gundu
1 Replies
Login or Register to Ask a Question