Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditional that compare value to lookup table #367

Open
TobiasNx opened this issue Sep 18, 2024 · 4 comments
Open

Add conditional that compare value to lookup table #367

TobiasNx opened this issue Sep 18, 2024 · 4 comments
Labels

Comments

@TobiasNx
Copy link
Collaborator

TobiasNx commented Sep 18, 2024

We have a list of records that we want to keep and a dump. We only want to keep the records that are also listed in a certain column. A conditional would be great that tests the values against a filemap.

put_filemap("path","newMap",...)

unless in_map("001","newMap","0")
	reject()
end
@TobiasNx
Copy link
Collaborator Author

Additional this should be able to check a simple textfile with one column.

@blackwinter
Copy link
Member

Does this warrant a dedicated predicate? It should be possible to achieve the desired outcome with existing tools (untested):

put_filemap("path", "newMap", key_column: "0", value_column: "0")
copy_field("001", "@in_map")
lookup("@in_map", "newMap", delete: "true")
unless exists("@in_map")
  reject()
end

@TobiasNx
Copy link
Collaborator Author

Does this warrant a dedicated predicate? It should be possible to achieve the desired outcome with existing tools (untested):

put_filemap("path", "newMap", key_column: "0", value_column: "0")
copy_field("001", "@in_map")
lookup("@in_map", "newMap", delete: "true")
unless exists("@in_map")
  reject()
end

I think it would be ok.
How would this work with a single column textfile?

@blackwinter
Copy link
Member

How would this work with a single column textfile?

Just specify expected_columns (1 or -1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants