Good day people!
Today, I was wondering how to paste several files with this delimiter: ,,.
When I use like:
paste -d',,' ...
The output only introduce one ,
I need double comma for better handling csv files, Thanks in advance for any clue
If you can identify a character which is not used in the file, you can do this in two steps.
paste -d '~' file1 file2 | sed 's/~/,,/'
Obviously, if the tilde already exists in your data, use a different delimiter. A control character could be a fairly safe bet, at the expense of being slightly pesky to manipulate. (In Bash, you can use e.g. $'\001' to produce a ctrl-A, etc.)
This works:
paste -d, file1 /dev/null file2
The documentation says:
If end-of-file is reached on an input file while other input files still contain data, the file is treated as if it were an endless source of empty lines.
Since /dev/null returns EOF immediately, it will simply be an endless source of blank lines. These will be inserted as an empty field between the contents of the two real files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With