new to hledger

22 views
Skip to first unread message

guido

unread,
Dec 27, 2022, 5:51:43 AM12/27/22
to hledger
hi everyone, just a very inexperienced user trying to set up hledger... sorry if posting completely trivial questions! 

I just noticed that `skip 2` in CSV import does not skip the first line in my CSV statement but gives an error: 

="XXXXXXXXXXXXXXXXX";27/06/2022;26/12/2022;
date_comptabilisation;libellé_complet_operation;montant_operation;devise;
(rest of the cvs follows)

If I manually remove the first line and use `skip 1' then it works.
Is this normal behaviour? 

Another problem that I have is that I need to write a script to convert from ISO8859-1 to UTF and I don't know what is the best way to automatize this task. 

Thanks! 

Henning Thielemann

unread,
Dec 27, 2022, 5:54:37 AM12/27/22
to hledger

On Tue, 27 Dec 2022, guido wrote:

> Another problem that I have is that I need to write a script to convert
> from ISO8859-1 to UTF and I don't know what is the best way to
> automatize this task. 

iconv -f latin1 -t utf8 <input.txt >output.txt

Simon Michael

unread,
Dec 27, 2022, 12:41:30 PM12/27/22
to hledger
Welcome Guido. I see a similar thing with skip now and then, could it be explained by blank lines ? I think those are stripped automatically, in addition to skip.



--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hledger/fe25d8b2-4f1c-4447-b3c8-4a8e8e7b2ad4n%40googlegroups.com.

guido

unread,
Dec 27, 2022, 12:47:25 PM12/27/22
to hledger
Thanks for you help!

It seems it doesn't want to skip the first line in:

="XXXXXXXXXXXXXXXXX";27/06/2022;26/12/2022;
date_comptabilisation;libellé_complet_operation;montant_operation;devise;
(rest of the cvs follows)

my workaround is to remove the first line with a script using " sed '1d' ".

My current problem is that my bank statements have dates of the format YYYYMMDD and the format

date-format %Y%m%d

in the rule file does not work... 

Thanks!

Simon Michael

unread,
Dec 27, 2022, 5:26:38 PM12/27/22
to hledger
That was strange indeed. There are two issues: we can only read RFC4180-compliant CSV/SSV/TSV, which does not allow double quotes inside a non-double-quoted value. And, we currently require even skipped lines to be valid RFC4180 data, which makes `skip` ineffective here as you said. I opened 

Simon Michael

unread,
Dec 27, 2022, 5:27:31 PM12/27/22
to hledger
PS your date-format works for me, let us know if that is still giving trouble.

guido

unread,
Dec 29, 2022, 5:58:09 AM12/29/22
to hledger
Thanks, the date-format indeed works. 

The problem was that the TAB-separated file provided by my bank has the .TAB extension, I had to change it too .csv otherwise I would get an error. 

Thanks again for the help!

Simon Michael

unread,
Dec 29, 2022, 6:25:11 AM12/29/22
to hledger
.tsv is the best file extension for TSV data. WIth .csv, it will require `separator TAB` in the rules file I think.


Reply all
Reply to author
Forward
0 new messages