[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#65416: Feature request: include first line of file in output
From: |
arnold |
Subject: |
bug#65416: Feature request: include first line of file in output |
Date: |
Mon, 21 Aug 2023 10:57:14 -0600 |
User-agent: |
Heirloom mailx 12.5 7/5/10 |
Daniel Green <ddgreen@gmail.com> wrote:
> I'm frequently searching CSV files with 20-30 columns, and when there's a
> hit it can be hard to know what the columns are. An option to also print
> the first line of a file (either always, or only if that file had a match
> to the pattern) in addition to any hits would be nice.
>
> Thanks,
> Dan
It sounds like awk would be a better tool:
awk 'FNR == 1 || /pattern/' files ...
should do the trick.
HTH,
Arnold
- bug#65416: Feature request: include first line of file in output, Daniel Green, 2023/08/21
- bug#65416: Feature request: include first line of file in output,
arnold <=
- bug#65416: Feature request: include first line of file in output, Daniel Green, 2023/08/21
- bug#65416: Feature request: include first line of file in output, arnold, 2023/08/21
- bug#65416: Feature request: include first line of file in output, Paul Eggert, 2023/08/21
- bug#65416: Feature request: include first line of file in output, Daniel Green, 2023/08/23
- bug#65416: Feature request: include first line of file in output, arnold, 2023/08/22
- bug#65416: Feature request: include first line of file in output, Carlo Arenas, 2023/08/23
- bug#65416: Feature request: include first line of file in output, Paul Jackson, 2023/08/23
- bug#65416: Feature request: include first line of file in output, Paul Jackson, 2023/08/23
- bug#65416: Feature request: include first line of file in output, Daniel Green, 2023/08/23
- bug#65416: Feature request: include first line of file in output, Paul Jackson, 2023/08/23