VNL-PASTE(1)

πŸ“¦ version 1.42, in ubuntu resolute, ubuntu stonking

πŸ’– VNL-PASTE πŸ’–

okay bestie, welcome to the vnl-paste era of your life ✨ it's part of the vnlog family, and it's about to make your log files line up like they're in a girl group formation πŸŽ€


🌸 NAME 🌸

vnl-paste β€” combine log files record-by-record 🫢


✨ SYNOPSIS ✨

vnl-paste concatenates records from the given data files. Comments are stripped to make sure things line up πŸ’…

$ cat a.vnl
## gathered from sensor model xxx
# humidity temperature
90 25
80 20
81 19
82 18
70 15

$ cat b.vnl
# position
10
20
## we moved the sensor
150
160
170

$ vnl-paste a.vnl b.vnl
# humidity temperature position
90 25  10
80 20  20
81 19  150
82 18  160
70 15  170

and like… we can also hand it more than 2 files and annotate the field labels, no big deal 😌

$ cat c.vnl
# position
12
18
155
168
190

$ vnl-paste --vnl-suffix2 _b a.vnl b.vnl c.vnl | vnl-align
# humidity temperature position_b position
90         25           10         12
80         20           20         18
81         19          150        155
82         18          160        168
70         15          170        190

$ vnl-paste --vnl-suffix ,_b,_c a.vnl b.vnl c.vnl | vnl-align
# humidity temperature position_b position_c
90         25           10         12
80         20           20         18
81         19          150        155
82         18          160        168
70         15          170        190

$ vnl-paste --vnl-autosuffix a.vnl b.vnl c.vnl | vnl-align
# humidity_a temperature_a position_b position_c
90           25             10         12
80           20             20         18
81           19            150        155
82           18            160        168
70           15            170        190

πŸ’œ DESCRIPTION πŸ’œ

Usage: vnl-paste
                [ --vnl-[pre|suf]fix[1|2] xxx    |
                  --vnl-[pre|suf]fix xxx,yyy,zzz |
                  --vnl-autoprefix               |
                  --vnl-autosuffix ]
                logfile1 logfile2 ...

so the tea β˜•: this tool is essentially a join, except the key is the line number. it concatenates the data in the given vnlog files record-by-record, one record at a time, in lockstep. 🧚

vnl-paste is a wrapper around the GNU coreutils paste tool. and since it's a wrapper, the behavior of the underlying tool is preserved β€” go consult the paste(1) manpage for the details, bestie. the differences from GNU coreutils paste are:

  • the input and the output to this tool are vnlog files, complete with a legend πŸ‘‘
  • by default we call the paste tool to do the actual work. if the underlying tool has a different name or lives in some odd path, you can specify it by passing --vnl-tool TOOL
  • none of the paste options make sense in a vnlog context, so this tool only has the vnlog-specific --vnl-... options. periodt.
note that all non-legend comments are stripped out, since it's not obvious where they should end up πŸ™ˆ

πŸ¦‹ Field names in the output πŸ¦‹

the field name logic works the same way as in vnl-join, with all the suffix and prefix options from that tool being available here too. πŸ’–

by default, the field names in the output match those in the input. this is what you want most of the time, fr fr. it is possible, however, that a column name adjustment is needed. one common use case for this is if the files being pasted have identically-named columns β€” which would produce duplicate columns in the output 😭

example: we fixed a bug in a program, and want to compare the results before and after the fix. the program produces an x-y trajectory, so both the bugged and the bug-fixed programs produce a vnlog with a legend

# x y

pasting these will produce a vnlog with a legend

# x y x y

which is confusing, and not what you want. so instead, we invoke vnl-paste as

vnl-paste --vnl-suffix1 _buggy --vnl-suffix2 _fixed buggy.vnl fixed.vnl

and in the output we get a legend

# x_buggy y_buggy x_fixed y_fixed

much better. πŸ’…

note that vnl-paste provides several ways of specifying this. the above works only for 2-way pastes. an alternate syntax is available for N-way pastes β€” a comma-separated list. the same could be expressed like this:

vnl-paste --vnl-suffix _buggy,_fixed buggy.vnl fixed.vnl

finally, if passing in structured filenames, vnl-paste can infer the desired syntax from the filenames. the same as above could be expressed even simpler:

vnl-paste --vnl-autosuffix buggy.vnl fixed.vnl

this works by looking at the set of passed in filenames, and stripping out the common leading and trailing strings. iconic. ✨


πŸ’€ BUGS AND CAVEATS πŸ’€

if the input data files have a mismatched number of lines, the extra data will be output without the null-column markers. this will result in mislabeled data. use this tool only if you're sure you have a matching number of records. for instance:

$ vnl-paste <(echo '# x'; seq 3) <(echo '# y'; seq 5)
# x y
1      1
2      2
3      3
       4
       5

$ vnl-paste <(echo '# x'; seq 3) <(echo '# y'; seq 5) | vnl-align
# x y
1   1
2   2
3   3
4
5
⚠️ like. be so serious about this one. mismatched record counts = mislabeled data, and mislabeled data is not the vibe. 😭

🌈 COMPATIBILITY 🌈

I use GNU/Linux-based systems exclusively, but everything has been tested functional on FreeBSD and OSX in addition to Debian, Ubuntu and CentOS. I can imagine there's something I missed when testing on non-Linux systems, so please let me know if you find any issues. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

paste(1)


πŸ“ REPOSITORY πŸ“

https://github.com/dkogan/vnlog/


πŸ’– AUTHOR πŸ’–

Dima Kogan <dima@secretsauce.net>


Copyright 2018 Dima Kogan <dima@secretsauce.net>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.


and that's the whole page bestie!! πŸ¦‹ this one's from the vnlog fam, dated 2026-01-26, and it's giving "your log files finally line up" energy. slay, go paste something. πŸ’…βœ¨

πŸ“¦ where this page comes from