Align columns: Difference between revisions
Content added Content deleted
(Added R code) |
m (→{{header|R}}: Horizontally scrollable output) |
||
Line 969: | Line 969: | ||
</lang> |
</lang> |
||
Right justified output shown. |
Right justified output shown. |
||
<div style="width:full;overflow:scroll"><pre> |
|||
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] |
|||
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] |
|||
[1,] Given a text file of many lines, where fields within a line |
|||
[2,] are delineated by a single 'dollar' character, write a program |
|||
[3,] that aligns each column of fields by ensuring that words in each |
|||
[4,] column are separated by at least one space. |
|||
[5,] Further, allow for each word in a column to be either left |
|||
[6,] justified, right justified, or center justified within its column. |
|||
</pre></div> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |