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

Unable to import csv-file from splitwise in NC 27 #216

Open
Matsched opened this issue Jul 4, 2023 · 4 comments
Open

Unable to import csv-file from splitwise in NC 27 #216

Matsched opened this issue Jul 4, 2023 · 4 comments

Comments

@Matsched
Copy link

Matsched commented Jul 4, 2023

NC Version: 27.0
Cospend Version 1.5.10

If i try to import a exported .csv-File from SplitWise i get:
Fehler beim Importieren der Projektdatei: Malformed CSV, impossible to find the column names
(Error while importing the project data)

This is the format from splitwise:

Datum,Beschreibung,Kategorie,Kosten,Währung,Name1,Name2
2023-06-22,Lebensmitteleinkauf REWE,Lebensmittel,2,EUR,-1,1

How i can change it to import it correctly to Cospend?
Can you fix this?

kind regards

@Matsched Matsched changed the title Unable to import csv-file from splitwise Unable to import csv-file from splitwise in NC 27 Jul 4, 2023
@Matsched Matsched reopened this Jul 18, 2023
@k-jell
Copy link

k-jell commented Sep 19, 2023

Maybe have a look here:
https://gitlab.com/eneiluj/cospend-nc/-/merge_requests/152

It only works if Splitwise account language is set to English (column names are localized)

Not sure if this is still the case, but it seems like it was, when the feature was implemented.

Edit:
It is: #159 (comment)

@Jolg42
Copy link
Contributor

Jolg42 commented Dec 3, 2023

It happened to me too, my account was set to French, so I switched it to English.

The language can be changed here
https://secure.splitwise.com/account/settings
Screenshot 2023-12-03 at 17 31 03

@Jolg42
Copy link
Contributor

Jolg42 commented Dec 3, 2023

The code is here after a quick search

public function importSWProject(string $path, string $userId): array {

Especially these lines are assuming the columns are in English

if (!array_key_exists('Date', $columns)
|| !array_key_exists('Description', $columns)
|| !array_key_exists('Category', $columns)
|| !array_key_exists('Cost', $columns)
|| !array_key_exists('Currency', $columns)

if (array_key_exists('Category', $columns)

if (array_key_exists('Category', $columns)

@Jolg42
Copy link
Contributor

Jolg42 commented Dec 3, 2023

I created a small PR to improve the error message #238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants