Search Results

Search: Posts Made By: tron12
1,921
Posted By MadeInGermany
So you compare the first 5 characters from the...
So you compare the first 5 characters from the 2nd column.
The awk code in post#3 repeats the substr(), can be shortened p=s.
I think the following is better readable, too:
awk '(NR > 1 &&...
1,921
Posted By Don Cragun
In addition to what Robin has already asked, one...
In addition to what Robin has already asked, one might note that there are no duplicate values in the second field in your sample input file. Is your real criteria for matching something like:

...
1,921
Posted By vgersh99
something along these lines if I undestand your...
something along these lines if I undestand your input/output samples correctly:

awk '{s=substr($2,1,5)} FNR>1 && s!=p {printf ORS }{p=substr($2,1,5)}1' myFile
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 01:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy