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).
  • 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).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 206 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 213 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 218 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 218 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 218 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 218 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 218 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.inc).
  • Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 218 of /home1/rholroyd/drupal/sites/richardholroyd.me/modules/views/plugins/views_plugin_cache.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).

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]

In this case, we're assuming a pipe delimited file (FS = "|") t called myfile.dat and we're going to get the line numbers of any rows that don't have 7 columns along with the count of columns in that row.

Or you can easily print the offending lines like this along with the line number:

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

Similarly, you might also want to validate the format of a single column, like this:

[geshifilter-pre] $ awk 'BEGIN { FS = "|" } ; { print $7 }' myfile.dat | grep '^[0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}$' [/geshifilter-pre]

Admittedly it's just a basic example and it's by no means perfect but you can see we're checking a date formatted as DD/MM/YYYY which is in the seventh column.