Created
June 18, 2020 09:43
-
-
Save zanculmarktum/8d0bedbf59b05a3a552aefbbc9af3908 to your computer and use it in GitHub Desktop.
Check if all fields are the same
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if all fields are the same. | |
NF > 1 { | |
i=2 # nth field to starts with | |
for (i; i<=NF; i++) { | |
for (j=i+1; j<=NF; j++) { | |
if ($i != $j) { | |
print $0 | |
break | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment