[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tabular format again
From: |
Wu Ming |
Subject: |
Tabular format again |
Date: |
Wed, 29 Nov 2023 21:00:26 +0800 |
Hello,
( printf “DIR#NAME#EMAIL\n" ; \
recsel -t Checks -p Dir,Name,Email customers.rec | recfmt -f format.txt ) |
column -t -s "#"
with format.txt:
{{Dir}}#{{Name}}#{{Email}}
It works. Output is a tabular format with provided header and enough spacing
between columns for neat alignment. A slight modification of the example
present in column’s man page.
Two details bothering me. First header info is present at recsel output
already. Second adding a custom separator for column to work. Because Name
field values contain spaces.
Then realised:
recsel -t Checks -p Dir,Name,Email customers.rec | rec2csv -d "#" | column -t
-s “#"
removes the need to repeat header info two more times. Custom separator stays.
Recutils are like magic.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Tabular format again,
Wu Ming <=