The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk - list to tables Lobaria Shell Programming and Scripting 10 04-24-2008 08:07 AM
Converting tables of row data into columns of tables justthisguy Shell Programming and Scripting 7 07-16-2007 04:42 PM
Routing tables kingdbag UNIX for Dummies Questions & Answers 9 10-06-2006 08:01 PM
viewing tables itldp UNIX for Dummies Questions & Answers 2 12-17-2003 09:19 AM
PHP: list into tables perleo Shell Programming and Scripting 2 10-01-2003 09:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-15-2008
amatuer_lee_3 amatuer_lee_3 is offline
Registered User
  
 

Join Date: May 2008
Posts: 53
Tables and borders

when i do this:

cat HITS

i get the following displayed:

sport.hits:87.114.172.31 Thu Sep 28 22:45:12 GMT 2006

how do i put this information into a bordered table?

so it will output like this:

...........File / IP..................Day.....Month.....Date............Time..............Year
sport.hits:87.114.172.31......Thu......Sep....... 28........22:45:12 GMT...... 2006
  #2 (permalink)  
Old 05-15-2008
fabtagon fabtagon is offline
Registered User
  
 

Join Date: Apr 2008
Location: European Union/Germany
Posts: 189
Don't know what you really want, but quite likely it would suit your needs to import that file as csv file into some spreadsheet like OpenOffice Calc and use space as separator instead of comma.
  #3 (permalink)  
Old 05-15-2008
amatuer_lee_3 amatuer_lee_3 is offline
Registered User
  
 

Join Date: May 2008
Posts: 53
basically what i want is for my output to be displayed in a table that has a border.

i am running a script that searches ip adresses from various files.
the files are displayed (using cat HITS) once they have been searched.
they are displayed from a file called HITS

they are displayed in a list like this when they are output:

adventure.hits:223.79.87.212 Tue Sep 05 02:19:02 GMT 2006

i want to be able to have this output placed in a table format with borders and headings for each column:

File / IP
Day
Month
Date
Time
Year

does this explain it a bit better?
  #4 (permalink)  
Old 05-15-2008
Dave Miller's Avatar
Dave Miller Dave Miller is offline
Registered User
  
 

Join Date: Dec 2007
Location: Northern NJ, USA
Posts: 151
If you know html, it's not too hard to wrap the data with row and cell tags, and also insert the remainder of the page layout tags, so the resulting file will open with any browser, and look like a half-way decent table with lines.

A few years ago, I did something similar where I generated html code from a program I wrote in a freeware version of Basic of all things.
  #5 (permalink)  
Old 05-15-2008
amatuer_lee_3 amatuer_lee_3 is offline
Registered User
  
 

Join Date: May 2008
Posts: 53
it wont be running on the internet. but i do know html.

would it still work?
  #6 (permalink)  
Old 05-15-2008
fabtagon fabtagon is offline
Registered User
  
 

Join Date: Apr 2008
Location: European Union/Germany
Posts: 189
What do you want to do with that table?

Use as input for some dumb script requiring constant length fields -> you need a real script solution
Simply have good looking logs -> go for csv or html idea

html idea: no, you don't need to be connected to the internet therefore, you just need a browser to view that html file. Even if you are on a text terminal (and do not want to copy that file to some X-machine) you can use lynx or w3m to view that html file.
  #7 (permalink)  
Old 05-15-2008
Dave Miller's Avatar
Dave Miller Dave Miller is offline
Registered User
  
 

Join Date: Dec 2007
Location: Northern NJ, USA
Posts: 151
Quote:
Originally Posted by amatuer_lee_3 View Post
it wont be running on the internet. but i do know html.

would it still work?
Yes. html pages do not have to go thru the internet to be able to be opened like an internet page. As long as whoever gets the file has an internet browser, the browser will be used to open it.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0