?
Solved

LInux Command

Posted on 2011-03-04
6
Medium Priority
?
335 Views
Last Modified: 2013-12-16
You want to print out a text file called vacations however the lines are of varying length. What text filter could you use to even out the length of the lines?
0
Comment
Question by:Reddy4U-Solaris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 31

Expert Comment

by:farzanj
ID: 35040365
Please show sample line.
How do you want to even them out?  Chop off what?
0
 
LVL 4

Expert Comment

by:Tachion
ID: 35040376
Use enscript,

See "man enscript". It works with most postscript aware printers.
If your printer is not postscript, use enscript to create a postscripts file, use ps2pdf to create a pdf and then print the pdf.


ENSCRIPT(1)                        ENSCRIPT                        ENSCRIPT(1)

NAME
       enscript - convert text files to PostScript, HTML, RTF, ANSI, and overstrikes

SYNOPSIS
       enscript  [-123456789BcgGhjkKlmOqrRvVzZ]  [-#  copies] [-a pages] [-A align] [-b header] [-C[start_line]] [-d
       printer] [-D key[:value]] [-e[char]] [-E[lang]] [-f font] [-F header_font] [-H[num]] [-i indent] [-I  filter]
       [-J title] [-L lines_per_page] [-M media] [-n copies] [-N newline] [-o outputfile] [-o -] [-p outputfile] [-p
       -] [-P printer] [-s baselineskip] [-S key[:value]] [-t title] [-T tabsize] [-u[text]] [-U num] [-W  language]
       [-X encoding] [filename ...]

DESCRIPTION
       Enscript  converts  text  files to PostScript or to other output languages.  Enscript can spool the generated
       output directly to a specified printer or leave it to a file.  If no input files  are  given,  enscript  pro-
       cesses  the  standard input stdin.  Enscript can be extended to handle different output media and it has many
       options which can be used to customize the printouts.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 35040397
As this is most likely an assignment question, we aren't permitted to give you a full solution, but we can point you in the right direction.

Look into

awk
sed
cut
perl
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 31

Expert Comment

by:farzanj
ID: 35040405
If you have written a program and which needs to be printed with correct indentation, use expand
0
 
LVL 1

Expert Comment

by:notjames
ID: 35041736
Perl and printf() could be your friend. For that matter, awk and printf() could be your friend. Cut could be a really quick fix. Unfortunately, shell's printf is lame. :)

I'd use Perl but that's just me. Tis simple if you put some thought into it. Specificity could be required if you need more assistance. G'luck.
0
 
LVL 2

Accepted Solution

by:
maxalarie earned 2000 total points
ID: 35084712
heh.. I would just cat $filename | lpr
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question