Error message

  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).
  • Warning: Illegal string offset 'field' in DatabaseCondition->__clone() (line 1901 of /home1/rholroyd/drupal/drupal-7.12/includes/database/query.inc).

gawk

Verifying delimited file formats the easy way

During the last week I've been having to validate (pipe) delimited files with many millions of lines of data before passing them off for import to another system. Some of that data was user generated and unfortunately played havoc with the file format.

So, if you have an agreed format of for a delimited file you can very quickly check that you have the expected column count on each line with (g)awk like this:

[geshifilter-pre] $ awk 'BEGIN { FS = "|" } ; { if( NF-1 != 7 ) print NR ":" NF-1 }' myfile.dat [/geshifilter-pre]

Subscribe to RSS - gawk