![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Building Full-Text Search Applications with Oracle Text | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 02:10 AM |
| c program to extract text between two delimiters from some text file | kukretiabhi13 | High Level Programming | 5 | 01-22-2008 02:42 AM |
| Copying Text between two unique text patterns | spindoctor | UNIX for Dummies Questions & Answers | 2 | 05-28-2007 12:15 PM |
| text formating/Text space padding | hugow | UNIX for Dummies Questions & Answers | 6 | 06-29-2005 06:49 AM |
| grep multiple text files in folder into 1 text file? | coppertone | UNIX for Dummies Questions & Answers | 7 | 08-23-2002 11:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
columnating text
I have a file /T, where the text of that file is:
1 2 3 4 5 6 I wish to change that to a two-column format column </T --(output set to new document) gets: 1 2 3 4 5 6 which probably makes sense as I have no option and no argument. column -c <T (output set to new document) yields nothing, which makes sense because I haven't specified an argument column -c 2 </T -- (output set to new document) I expect 1 2 3 4 5 6 BUT get 1 2 3 4 5 6 It would seem I'm specifying the argument incorrectly. If that's true, what is the proper syntax? And, if I can get past the above problem, what's the story with an -x option; it doesn't appear in the "man column" I've looked at, but elsewhere I've seen it stated that (with that option) I should get: 1 4 2 5 3 6 help? TIA |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
I have never used this command before, but there's a first time for everything. Playing around a little I get...
Code:
$ column -c20 < ./T 1 4 2 5 3 6 $ column -c20 -x < ./T 1 2 3 4 5 6 $ |
|
#3
|
||||
|
||||
|
Hi.
I think the columns command is somewhat deceiving. The option "-c" does allow you to specify "columns", but it is the column-width of the display area, not "columns" of data. A useful exercise might be to find the length of the file in lines, split the file, and use paste to read the splits -- provided the data fits into data-columns within the display-columns |
||||
| Google The UNIX and Linux Forums |