Closed kosnik-ng closed 2 years ago
For the column sorting, If the column name has an accent or a space, the same error occurs :
Error evaluating filter expressions: Lexical error on line 1. Unrecognized text.
Société
----^.
with this code
columns:
- Nom de famille
- Prénom
- Société
- Emails
- Téléphones
- Localité
- Région
- URL
- Notes
source: contact/export-contacts.csv
sortBy:
- Société
or
columns:
- Nom de famille
- Prénom
- Société
- Emails
- Téléphones
- Localité
- Région
- URL
- Notes
source: contact/export-contacts.csv
sortBy:
- Nom de famille
Unfortunately, the library we're using for handling filter expressions and sorting (filtrex) doesn't support non-ascii column names in much the same way that a programming language isn't likely to support them for variable names -- and that's because under the hood, those column names are variable names. There's good news, though: you can easily set a variable name for your columns by using the extended syntax discussed here: https://github.com/coddingtonbear/obsidian-csv-table#user-content-selecting-particular-columns
Unfortunately, this does mean that your CSV file's header line should contain only ascii characters given that those header entries are used like variable names throughout the filtering and sorting system, but you can easily change the displayed header using the instructions above. E.g.
```
columns:
- expression: nom_de_famille
name: Nom de famille
- expression: prenom
name: Prenóm
...
```
I know this isn't the answer that you want to hear, and I'm sorry about that! If it helps: this limitation applies even for English headers, it's just a little less likely to pinch in English given that we'll only run into the problem if we have a header having a space in its name.
Good luck!
Hello, My cvs file contains the items below:
In the source file, I wrote:
If the column name to be filtered contains accents, the following error is encountered:
I have tried with single and double quotes, but it does not work.
The accents are not a problem in the values, it matches correctly: