If data is space separated:
awk '$1=="624"' names.dmp
If your grep supports -w
you can use:
grep -w "^624" names.dmp
-w, --word-regexp force PATTERN to match only whole words
or
grep "^624 " names.dmp
(See the space after 624
)
PS If data is separated by |
, then you need this awk
awk -F\| '$1=="642"' names.dmp
And for grep
this should do:
grep "^642|" names.dmp