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

Problem using pica filter in Powershell (Win10) #759

Open
jaohbib opened this issue Feb 12, 2024 · 2 comments
Open

Problem using pica filter in Powershell (Win10) #759

jaohbib opened this issue Feb 12, 2024 · 2 comments
Assignees
Labels
A-filter Area: The filter command C-documentation Category: documentation
Milestone

Comments

@jaohbib
Copy link

jaohbib commented Feb 12, 2024

I run the latest i686-pc-windows-msvc release (v0.24.0)

i use the following command in PowerShell
.\pica.exe filter -s '[email protected] == "118540238"' .\kxp.gz -o goethe.dat2
I receive the folowing error error: invalid record matcher (got [email protected] == 118540238)
The used command is an example provided by https://deutsche-nationalbibliothek.github.io/pica-rs/book/referenz/kommandos/filter.html

I switched to Linux version of pica-rs where this command works as expected
Is this a user error on my part ? is the windows build functioning ?

@nwagner84
Copy link
Member

nwagner84 commented Feb 12, 2024

Hi,

can you try switching from single- to double-quotes:

.\pica.exe filter -s "[email protected] == '118540238'" .\kxp.gz -o goethe.dat2

I recently discovered that the handling of single-/double-quotes in windows is different than linux.

Update:

Single-quoted strings are interpreted literally by PowerShell. It's necessary to double the quotation-marks in a single quoted string. The following command worked as expected:

.\pica.exe filter -s '[email protected] == ""118540238""' .\kxp.gz -o goethe.dat2

I'm going to update the documentation this week and add a note about when to use which quote-style.

See also: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.4

NB: Please note that there is also a problem with pica-rs and PowerShell: #371 . I recommend using Linux or cmd.exe.

@nwagner84 nwagner84 self-assigned this Feb 12, 2024
@jaohbib
Copy link
Author

jaohbib commented Feb 12, 2024

maybe WSL would be the better option for Pica-rs on Windows Win 7 and 8 are EOL WSL is available in Win 10/11

@nwagner84 nwagner84 added C-documentation Category: documentation A-filter Area: The filter command labels Sep 1, 2024
@nwagner84 nwagner84 added this to the v1.0.0 milestone Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-filter Area: The filter command C-documentation Category: documentation
Projects
None yet
Development

No branches or pull requests

2 participants