pr <(ls ./) > out.txt
The -t option takes away the heading and margins at the top and bottom of each page. That's useful when "pasting" data into columns with no interruptions.
pr -t <(ls ./) > out.txt
The -m option reads all files on the command line simultaneously and prints each in its own column.
The -m option reads all files on the command line simultaneously and prints each in its own column.
pr -m -t <(ls ./) > out.txt
pr -s' ' -m -t <(ls ./) > out.txt
pr -s' ' -h 'my heading' -m -t <(ls ./) > out.txt
An option that's a number will print a file in that number of columns. For instance, the -3 option prints a file in three columns. The file is read, line by line, until the first column is full (by default, that takes 56 lines). Next, the second column is filled. Then, the third column is filled. If there's more of the file, the first column of page 2 is filled -- and the cycle repeats
pr -s' ' -h 'my heading' -3 -t <(ls ./) > out.txt
Order Lines Across Columns: -l
Do you want to arrange your data across the columns, so that the first three lines print across the top of each column, the next three lines are the second in each column, and so on?
pr -l1 -t -3 <(ls ./) > out.txt
No comments:
Post a Comment