reset password
Author Message
giraid
Posts: 39
Posted 16:20 Mar 08, 2015 |

This is for the Saturday class's Starbucks assignment.

I ran into a ArrayOutOfBound exception when working on the parser, turned out the culprit was this line,

1008673,"Wembley, Civic Centre",Starbucks,22021-216985,,FR,"""Brent Civic Centre, Engineers Way, 
""","""Brent Civic Centre, Engineers Way, 
""",,,Wembley,ENG,GB,HA9 0FJ,"(51.5585784912109, -0.28064501285553)",51.55857849,-0.280645013,GMT Standard Time,60,GMT+0:00 Europe/London,3/5/14 5:00

 

Does anyone know how to fix this line? I  ended up deleting it altogether, but not sure whether I'm supposed to do that.

Last edited by giraid at 16:23 Mar 08, 2015.
gjmiles
Posts: 17
Posted 19:14 Mar 08, 2015 |

There are two "^M" characters in that line that is causing the exception.  I use emacs as my text editor and it shows the characters.  Maybe for windows if you try with notepad++?

giraid
Posts: 39
Posted 20:55 Mar 08, 2015 |

The code I posted is copied from notepad++, I don't see any ^M's. What throws me off is the triple quotes and the weird line breaks. Could "^M" be some sort of line breaker?

gjmiles
Posts: 17
Posted 21:52 Mar 08, 2015 |

Not sure if it is a line break or not. 

I use linux and when I opened the file in emacs and deleted the "^M" characters it solved the problem. 

I have not tried looking at the file in any other text editors or operating systems.