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

Enable filtering options (filterColumn, filterQuery) for additional export formats (currently templating only) #17

Open
dla-fritz opened this issue Mar 31, 2021 · 4 comments

Comments

@dla-fritz
Copy link

Hi!

I started the OpenRefine client like this:

./openrefine-client_0-3-10_windows.exe --filterColumn="KLAS" --filterQuery="^SPTT1$" --export mume -H refine.local.lan -P 8800

The filtering does not work and all datasets/entries are exported.

Is this a bug or do I need the --template flag for filtering?

Server version is OpenRefine Version 2017-10-28 [TRUNK]

Thanks and best regards,

Steffen

@felixlohmeier
Copy link
Member

Hi @dla-fritz, your guess is correct. These options are indeed implemented only for the Templating Exporter.

Which format do you want to export to? Maybe I can provide you with a suitable template for the --template option.

@dla-fritz
Copy link
Author

dla-fritz commented Mar 31, 2021

Thanks for the quick reply!

I need a simple txt file that contains one value per line from the column MOPATH where the filter --filterColumn="KLAS" --filterQuery="^SPTT1$" matches, e.g.

/fileserv/foo/bar/scan_img_0.tiff
/fileserv/foo/bar/scan_img_2.tiff
...

The paths are Windows path in OpenRefine, e.g.

\fileserv\foo\bar\scan_img_0.tiff

I modified this with awk, but I guess s/\\/\//g is also possible with GREL? However, this would be just a nice to have.

A simple textfile with the pathes is sufficent!

Thanks again!

Steffen

@felixlohmeier
Copy link
Member

Here you are 😄

Test data (create from clipboard):

MOPATH,KLAS
\fileserv\foo\bar\scan_img_0.tiff,SPTT1
\fileserv\foo\bar\scan_img_2.tiff,SPTT2

Templating Export Dialog

  • Prefix: (blank)
  • Row Template:
    {{cells['MOPATH'].value.replace('\\','/')}}
    
  • Row Separator: (line break)
  • Suffix: (blank)

Filtering with openrefine-client:

openrefine-client_0-3-10_windows.exe --export clipboard --template "{{cells['MOPATH'].value.replace('\\','/')}}" --filterColumn="KLAS" --filterQuery="^SPTT1$"

Screenshot from 2021-03-31 12-05-46

@dla-fritz
Copy link
Author

Awesome, thanks! I added "Learn GREL!" to my ToDo list and "RTFM" :)

Thanks again,

Steffen

@felixlohmeier felixlohmeier changed the title Filtering is not working Enable filtering options (filterColumn, filterQuery) for additional export formats (currently templating only) May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants