Utils like rs and datamash work as though the lines and field separators of a given file were members of a 2-dimensional array. Text utils that work with columns and fields might also be loosely grouped in this 2d category, (cut, head, tail, paste, join, etc.).

If lists of filenames are considered as a third dimension, we have a crude 3d. Given a list of filenames, if we wish to print the 3rd file's 3rd row's 3rd column, we can pipe various utils together and get a result. But can any util, (that's not a language), do that in one command?

# Hypothetical program syntax.
# output row 3, col 3, of file3 (i.e. the third file in list)
foobar3dcut -f 3,3,3 file1 file2 file3 file4 file5


# Output 2d table of column 3s (one column from each file)
foobar3dcut -f .,3,. file1 file2 file3 file4 file5

Higher dimensions than 3d (e.g. directories) would be good also...

Not very relevant: General or special purpose programming languages. Spreadsheets. Recommendations for emulating 3d output with a series of pipes and filters, or with find, set, xargs, et al. Reflections on the typeless 1d nature of file streaming.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.