Unfortunately I can't really show the data, it has patient information
. To be exact, I have 83 columns/fields and 32,224 rows/lines of data - comma seperated delimiter. I'm interested in the regex /hom/, but only as it appears in fields 43-83.
for example, a few lines will look like this:
PHP Code:
col 1 - 42 col 43 to 83
patient data - - - - - hom - - - - -
patient data - - - - - - - - - - - -
patient data - - hom - - - - - - - -
hom ....data - - - - - - - - - - - -
And I don't want to return the last line, which contains a "hom" in col 1 - 42
The code I used:
PHP Code:
awk -F"," '{ M=0; for(N=43; (!M) && (N<=83); N++) if($N ~ /hom/) M++; } M' input.csv >hom.csv
This code works, but my output file hom.csv only has 34 lines returned. By visual inspection, this is only the first 34 instances of "hom" in columns 43-83. I know by looking at my file that in line 23743, there is a "hom".
Any reason why this may be happening? Or will you have to see the entire file?
Thanks