Re: Bash --- columns problem ??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 15, 2007 6:07 AM, G.Wolfe Woodbury <ggw@xxxxxxxxxxxxxxxxxxx> wrote:
> On Sat, Dec 15, 2007 at 05:52:25AM -0500, William Case wrote:
> > Hi;
> >
> > I am having a bit of a brain cramp.
> >
> > I have a text file with 1100 one word lines in it.  I would like to
> > transpose that file into a three column text file reducing it from 23
> > pages to 8 pages before printing.  I did something similar from the
> > command line over a year ago, but for the life of me I can't remember
> > how.  I do remember that it was simple at the time.
> >
> > I have tried every possible combination I can think of with grep |
> > column.
> >
> > If this problem is familiar to someone could they just point me; tickle
> > my memory?
>
> There are some options to the pr(1) command that will multi-column on the way to
> printing.
>
> --
> Wolfe
>
In absence of that doing it, another option that comes to mind is a
simple for loop (looping to 3) that removes CR/LF (or is it just LF?)
and dumps that loop to the printer or a new file.  Put that loop
inside a larger for loop (for lines in ($cat {data_file}) do...).  I'd
have to take time to play around with it to get the exact syntax but
you get the general idea.  Or a sed command to remove all of the end
of lines (LF or CR/LF) such as "s/[\012\015]/ /g" to replace CR/LF
with a space instead to get a space delimited list of words and then
process it through pr if it doesn't work with the LF.

But the pr option suggested seems to be a valid option.  Check out
http://linux.about.com/library/cmd/blcmdl1_pr.htm (or man pr of
course).

Jacques B

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux