Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output of data in tables

Status
Not open for further replies.

jayyy

Programmer
Mar 1, 2008
7
BE
is there a simple way (using dos) to get output in tables?

like this

name birthday ...
Simon 08-04 ...
... ... ...


instead of

Print "name birthday ... "; and manually put them in tables
 
I think if you search through you find people doing it with printf or sprintf (I can't remember which). Or you can do it using tabs

print "Name\tBirthday\n";
print "Travis\t03/12/78\n";



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
If you have little formatting to do, just use the basic stuff, but if you have something you want to use as a template for data display/formatting look into perlform:


The pack() function is also a good choice. Combined with functions like sprintf you can output very nicely formatted terminal data.


------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
thank you that was where i was looking for
 
now there just one thing that doesn't work

to long variables couldn't be written

eg.

i want this:
name | sentence | nr
345 |This is a lon|
|g sentence |

but i get this
name | sentence | nr
345 |This is a lon|

i have been looking for it on the internet but i don't find the solution yet (maybe because my bad english)

 
nobody know how you can let it written on more lines?
 
jayyy,

post your perl code and show the input file/data

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top