I'm struggling with extracting a date value from a field name in a csv file. I have a field named "Status for 2014-28-07". I want to extract the date portion of the field name in order to determine if the file was generated for the current date. I know that having a separate date field would simplify things, but this is how the file is generated.
What's the best way to do this?
Take a look at this run-anywhere example:
| stats count | eval "Status for 2014-28-07" = "foo" | foreach "Status for 20*" [eval date = "20<<MATCHSTR>>"]
Result:
Status for 2014-28-07 date
foo 2014-28-07
Take a look at this run-anywhere example:
| stats count | eval "Status for 2014-28-07" = "foo" | foreach "Status for 20*" [eval date = "20<<MATCHSTR>>"]
Result:
Status for 2014-28-07 date
foo 2014-28-07
Brilliant! Just what I needed.
It is the column header. For example:
Id, Status for 2014-28-07
01, active
02, inactive
Is this column header OR a value in a column. If it is value in a column then what is the column header name.