>
> If you're certain that the headers are the same in each file,
> then there's no harm and much simplicity in reading them each
> time they come up.
>
> with fileinput ...:
> for line in f:
> if fileinput.isfirstline():
> headers = extract_headers(line)
> On 7 Sep 2019, at 16:33, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com>
> wrote:
>
>with fileinput ...:
>for line in f:
>if fileinput.isfirstline():
>headers = extract_headers(line)
>else:
>pass # process a non-header line
On 9/7/19 11:12 AM, Jason Friedman wrote:
$ grep "File number" ~/result | sort | uniq
File number: 3
I expected that last grep to yield:
File number: 1
File number: 2
File number: 3
File number: 4
File number: 5
File number: 6
As per https://docs.python.org/3/library/fileinput.html#fileinput.