out of these records I want to write those reocrds whcih
have alphanumeric chartacters(ex : space,allphabets,'A','B' etc)
at 8th filed to one file( i.e. filter out all the records which are having space or - as 34 A,34-A in the 8th filed of my file )and remaing to another file.
how to do this using awk or something else in UNIX?
#create a file something like 8thfield.txt with below mater
C;4498;qwa;cghy;;;;40;;222122
C;4498;sample;city;;;;34 2;;222123
C;4498;qwe;xcbv;;;;34-2;;222124
C;4498;jj;sffz;;;;41;;222120
C;4498;eert;qwq;;;;34 A;;222125
C;4498;jj;szxzzd;;;;34;;222127
#execute this command to separate the lines which contains 8th field as space or hypen
awk -F";" '{print $8}' 8thfield.txt | egrep " |\-" | xargs -i egrep "{}" 8thfield.txt > file1.txt
#execute this command to ignore the lines which contains 8th field as space or hypen
grep -v "`cat file1.txt`" 8thfield.txt