ledger-web icon indicating copy to clipboard operation
ledger-web copied to clipboard

Issue with long lines: 'Missing or stray quote error'

Open alysbrooks opened this issue 9 years ago • 0 comments

When I first tried to run ledger-web, I received an error when it attempted to load the ledger files into the database:

Loading database
Dumping ledger to file...
Dump finished
Clearing ledger table....
Done clearing ledger table
Loading into database....
Called #<Proc:0x007f84b9d61038@/Library/Ruby/Gems/2.0.0/gems/ledger_web-1.5.2/lib/ledger_web/watcher.rb:20>#call(<DirectoryWatcher::Event type: stable path: '/tmp/all_quoteless.dat'>) and all I got was this lousy exception Missing or stray quote in line 542

I was eventually able to determine that it was tripping over very long lines. Since these were all caused by comments, which all begin with a semicolon, I was able to fix it by stripping out anything that starts with a semicolon (and any leftover lines that start with whitespace) like so: sed "s/;.*//g" ledger.dat | sed "/^ +\$/d".

alysbrooks avatar Sep 15 '15 02:09 alysbrooks