I have two files which contain only one column of numeric data each, and the same number of rows. When using paste, it does combine the rows from the two files into one row, but the text of the first file is truncated, while the text from the second file is intact:

$ head -3 s1_.dat s2_.dat
==> s1_.dat <==

==> s2_.dat <==

$ paste s1_.dat s2_.dat | head -3

Are there column width limits in paste?


1 Answer 1


There shouldn't be a limit. It's just that at least your first input file has DOS/Windows -style CRLF line endings, where the carriage return (CR) returns the cursor position to the start of the line before the separating TAB and the next value are printed. Note how the value from the second file starts at position 8, at the first tab stop.

The actual output is something like this:


You can verify it if you view the output with e.g. od -c, it should show \r for the CR there.

Run the files or the output through tr -d '\r' to remove the CRs. (or dos2unix or any of the other various ways.)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.