Hi, I must write and read data from lookup files.
and I tried to read data using
| lookup file cn AS cn | table cn`
but it did not work.| lookup file cn OUTPUT cn`.
and this too
What should I do?
If all you want to do is read the contents of the lookup try the inputlookup command.
will list the entire contents of the lookup. You can search for a specific entry in the lookup using:
|inputlookup file.csv | search fieldname=whatever
To perform a lookup against the csv during a search would use the lookup command, like:
[main search] | lookup file.csv fieldname OUTPUT otherfieldnames|...
To write to a lookup you would use outputlookup.
|inputlookup file.csv|eval cn=if(cn=="something","something else",cn)|outputlookup file.csv
Will perform the lookup, and will change an entry in the field cn if it contains a specific value, and will then overwrite the original lookup (it is always advisable to test the results before performing this overwrite as errors can be embarrassing to fix).
Hope this helps,