title: fread together with grepl
body: <p>I have a data (large data 125000 rows, ~20 MB) in which some of the rows with certain string need to be deleted and some columns need to be selected during the reading process. </p>
  
  <p>Firstly, I discovered that <code>grepl</code> function does not work properly since <code>fread</code> makes the data as one column indicated also in this <a href="https://stackoverflow.com/questions/31959650/how-to-read-tab-separated-file-into-data-table-using-fread">question</a>.</p>
  
  <p>The example data can be found <a href="https://gist.github.com/demircity/4d2e3c06f72cacd75970" rel="noreferrer">here</a> (by following @akrun advice) and header of the data like this </p>
  
  <p>head(sum_data)</p>
  
  <pre><code>TRIAL :            1        3331        9091
    TRIAL :            2  1384786531   278055555
      2     0.10     0.000E+00 -0.0047 -0.0168 -0.9938    -0.0087 -0.0105 -0.9709     0.0035  0.0079 -0.9754     0.0081  0.0023  0.9997      -0.135324E-09    0.278754E-01
      2     0.20     0.000E+00 -0.0121  0.0002 -0.9898    -0.0364 -0.0027 -0.9925    -0.0242 -0.0050 -0.9929     0.0029 -0.0023  0.9998      -0.133521E-09    0.425567E-01
      2     0.30     0.000E+00  0.0193 -0.0068 -0.9884     0.0040  0.0139 -0.9782    -0.0158  0.0150 -0.9814     0.0054 -0.0008  0.9997      -0.134103E-09    0.255356E-01
      2     0.40     0.000E+00 -0.0157  0.0183 -0.9879    -0.0315 -0.0311 -0.9908    -0.0314 -0.0160 -0.9929     0.0040  0.0010  0.9998      -0.134819E-09    0.257300E-01
      2     0.50     0.000E+00 -0.0402  0.0300 -0.9832    -0.0093  0.0269 -0.9781    -0.0326  0.0247 -0.9802     0.0044 -0.0010  0.9997      -0.131515E-09    0.440350E-01
  </code></pre>
  
  <p>I attempted to read the data with <code>fread</code> and used <code>grepl</code> for removing the rows; </p>
  
  <pre><code>files &lt;-dir(pattern = "*sum.txt",full.names = FALSE)
  library(data.table)
  
  fread_files &lt;- function(files){
  sum_data_read &lt;- fread(files,skip=2, sep="\t", ) #seperation is tab.
  df_grep &lt;- sum_vgm_read [!grepl("TRI",sum_vgm_read$V1),] # for removing the lines that contain "TRIAL" letter in V1 column. But so far there is no V1 column is recognized!!
  
  df &lt;- bind_rows(df_grep)  #binding rows after removing 
  write.table(as.data.table(df),file = gsub("(.*)(\\..*)", "\\1_new\\2", files),row.names = FALSE,col.names = TRUE) 
  }
  </code></pre>
  
  <p>and finally <code>lapply</code></p>
  
  <pre><code>lapply(files, fread_files)
  </code></pre>
  
  <p>when I perfom this, only one row of data is created as an output which is something going on but I dont know what. 
  Thanks for help in advance!</p>