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

'substr' of null #1

Open
vorg opened this issue Jul 29, 2015 · 4 comments
Open

'substr' of null #1

vorg opened this issue Jul 29, 2015 · 4 comments

Comments

@vorg
Copy link

vorg commented Jul 29, 2015

I've been trying to parse some of my statements from 2014 and i'm getting this error

TypeError: Cannot read property 'substr' of null
    at renderers.csv2 (/usr/local/lib/node_modules/hsbc-statement-parser/hsbcextr.js:25:33)

If I console.log the sta variable i see it completely empty

{ filePath: 'json',
  acctNum: null,
  dateFrom: null,
  dateTo: null,
  balFrom: null,
  balTo: null,
  totDebit: null,
  totCredit: null,
  ops: [] }

I'm running the command as following:

./hsbcextr.sh json /Users/name/Dropbox/1412.pdf
@adrienjoly
Copy link
Owner

Hi Marcin,

Thank you for submitting this issue!

Was this the first/only time that you have ever used HsbcStatementParser?
What language is your statement file in? (I only tested it on French
statement files, so far)
Are you able to code?

I look forward to hearing from you!

Adrien

On Wed, Jul 29, 2015 at 4:44 PM, Marcin Ignac [email protected]
wrote:

I've been trying to parse some of my statements from 2014 and i'm getting
this error

TypeError: Cannot read property 'substr' of null
at renderers.csv2 (/usr/local/lib/node_modules/hsbc-statement-parser/hsbcextr.js:25:33)

If I console.log the sta variable i see it completely empty

{ filePath: 'json',
acctNum: null,
dateFrom: null,
dateTo: null,
balFrom: null,
balTo: null,
totDebit: null,
totCredit: null,
ops: [] }

I'm running the command as following:

./hsbcextr.sh json /Users/name/Dropbox/1412.pdf


Reply to this email directly or view it on GitHub
#1.

Adrien Joly
adrienjoly.com

@vorg
Copy link
Author

vorg commented Jul 30, 2015

Was this the first/only time that you have ever used HsbcStatementParser?

Yes

What language is your statement file in? (I only tested it on French statement files, so far)

English / UK

Are you able to code?

Yep

@vorg
Copy link
Author

vorg commented Jul 30, 2015

I think format is completely different. I switched to the code from you usage example now. It's missing the require:

var HsbcStatementParser = require('hsbc-statement-parser/HsbcStatementParser');

But doesn't help. I get can't get[0] of undefined at HsbcStatementParser.js#L29

After fixing it with:

return line ? line[0] : '';

I get error TypeError: Cannot read property 'pop' of null at HsbcStatementParser.js:203:2

@adrienjoly
Copy link
Owner

Hi Marcin,

Unfortunately, your issue is no surprise to me, as I hardcoded the parsing
based on French statement files...

The code could be refactored in order to support other languages. If I had
to do that I would probably rebuild it upon my latest PDF parsing module:
https://github.com/adrienjoly/npm-pdfreader

If you're interested in this project, I can help you on how to use that
module, and plug the French-specific module back to a more generic version
of HsbcStatementParser.

Best regards,

Adrien Joly

On Thu, Jul 30, 2015 at 4:39 PM, Marcin Ignac [email protected]
wrote:

I think format is completely different. I switched to the code from you
usage example now. It's missing the require:

var HsbcStatementParser = require('hsbc-statement-parser/HsbcStatementParser');

But doesn't help. I get can't get[0] of undefined at
HsbcStatementParser.js#L29
https://github.com/adrienjoly/HsbcStatementParser/blob/master/HsbcStatementParser.js#L29

After fixing it with:

return line ? line[0] : '';

I get error TypeError: Cannot read property 'pop' of null at
HsbcStatementParser.js:203:2
https://github.com/adrienjoly/HsbcStatementParser/blob/master/HsbcStatementParser.js#L202

So I think the format is quite different and I won't be able to use it.


Reply to this email directly or view it on GitHub
#1 (comment)
.

Adrien Joly
adrienjoly.com

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

2 participants