I have a csv file with loads of data. I wish to cut the 9th column for values >=1 and then use grep to display full rows that match.
Sample format:
ABC,XYZ,RTY,CREAM,FRANCE,170019,ST REMY CREME,3035540005229,0.75,1,15,26.99,10
ABC,RDS,XSD,SPICE,NETHERLANDS,390476,THE KINGS GINGER,5010493025621,1.5,1,41,49.95,NA
ABC,RMS,DKS,TABLE WINE RED,CHILE,400176,SANTA ISABELA,63657001349,3,1,12.5,31.99,0
I have tried with
grep . Myfile.csv |cut -d"," -f9 | sort |grep -E "^(1*[1-9][2-9]*(\.[2-9]+)?|1+\.[2-9]*[1-9][2-9]*)$"
but it only shows the 9th column values not the full rows with all the columns.
and also
grep $(cut -d"," -f9 Myfile.csv | grep -E "^(1*[1-9][2-9]*(\.[2-9]+)?|1+\.[2-9]*[1-9][2-9]*)$") Myfile.csv
Any help would be great.
PS: can't use awk (:-