On Wednesday, February 14th, 2024 at 11:39 AM, Rich Shepard <[email protected]> wrote:
> On Wed, 14 Feb 2024, Reid wrote: > > > The `NR ~ /1/` line is causing the first line to be printed, regardless of > > its contents. > > > Reid, > > With the full data set that's the column header row so I left it in the > script because I'm working with the full set. > > However, commenting it out I still get the Inactive records (and the Draft > ones because I've not yet removed those.) Okay, that's not my experience. Using your script and adding a row-number field to the end of each line: $ cat /tmp/tmp.txt 410 Auto Wrecking,410 Auto Wrecking,So3011780,Inactive,Industrial SW GP,27865 Sr 410 E,Buckley,Pierce,98321,ROW_1 410 Auto Wrecking,410 Auto Wrecking,WAR011780,Active,Industrial SW GP,27865 Sr 410 E,Buckley,Pierce,98321,ROW_2 410 Auto Wrecking,410 Auto Wrecking,So3011780,Inactive,Industrial SW GP,27865 Sr 410 E,Buckley,Pierce,98321,ROW_3 410 Auto Wrecking,410 Auto Wrecking,WAR011780,Active,Industrial SW GP,27865 Sr 410 E,Buckley,Pierce,98321,ROW_4 $ gawk -f /tmp/tmp.gawk /tmp/tmp.txt 410 Auto Wrecking,410 Auto Wrecking,So3011780,Inactive,Industrial SW GP,27865 Sr 410 E,Buckley,Pierce,98321,ROW_1 410 Auto Wrecking,410 Auto Wrecking,WAR011780,Active,Industrial SW GP,27865 Sr 410 E,Buckley,Pierce,98321,ROW_2 410 Auto Wrecking,410 Auto Wrecking,WAR011780,Active,Industrial SW GP,27865 Sr 410 E,Buckley,Pierce,98321,ROW_4 Note that the first "Inactive" line is printed because it's the first record. The second "Inactive" line is not printed. > > Thanks, > > Rich Regards, Reid Wahl (he/him) Sent with Proton Mail secure email.
