Re: Bash --- columns problem ??

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

 



On Saturday, Dec 15th 2007 at 05:52 -0000, quoth William Case:

=>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?

Why use grep or pr or any other shellout when you can just do it right 
from within bash?

myRead()
{
    typeset line1, line2, line3
    read line1
    read line2
    read line3
    echo "$line1 $line2 $line3"
    [[ -n "$line1" && -n "$line2" && -n "$line3" ]]
}
while myRead
do
    :
done < /usr/share/dict/words 

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

-- 
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