Closed GoogleCodeExporter closed 9 years ago
I triggered an "Error: newline inside string" in linux with the following test
def testHeaderQuoteNotClosed(self):
self.zip.writestr("test.txt", "\"test_id\",\"test_name\n")
results = list(self.loader._ReadCsvDict("test.txt",
["test_id", "test_name"], []))
self.assertEquals([], results)
e = self.problems.PopException("CsvSyntax")
self.problems.AssertNoMoreExceptions()
That error is only found in old versions of _csv.c by
http://google.com/codesearch?q="newline+inside+string"&hl=en&btnG=Search+Code
so it
may have been fixed in the csv library.
Original comment by tom.brow...@gmail.com
on 21 May 2009 at 9:47
Original comment by tom.brow...@gmail.com
on 28 Oct 2009 at 10:56
Issue 238 has been merged into this issue.
Original comment by tom.brow...@gmail.com
on 8 Jun 2010 at 6:19
Issue 240 has been merged into this issue.
Original comment by tom.brow...@gmail.com
on 16 Jun 2010 at 8:52
If you find you have a file causing this problem try loading it in a text
editor and saving it again. Try to use an editor that lets you select the file
format, you want something like MS/DOS. Look for lines that have a funny
character at the end or two lines that have been joined into one.
You could also try importing the file into a spreadsheet, such as Excel, and
then save to csv.
If you are comfortable with the command line try
perl -ibak -p -e 's/\r/\n/g' filename.txt
Original comment by the...@google.com
on 17 Jun 2010 at 4:17
I added this file awhile back and have not received a response to the issue.
Please advise. We would really like to get this up and running as soon as
possible. Thanks in advance.
Original comment by galen.be...@culvercity.org
on 29 Jun 2010 at 2:07
Attachments:
Galen, your stop_times file uses CR only end of line markers everywhere except
the last line, which ends with CR+LF. You should be able to fix this by loading
it in a text editor and saving in DOS format. Or run
perl -ibak -p -e 's/\r/\n/g' stop_times.txt
Original comment by tom.brow...@gmail.com
on 30 Jun 2010 at 4:16
Marissa is having the same problem with files at
http://cvtdbus.org/google/google_transit.zip
after saving them in various formats using text editor on a mac. Looking at the
files with hexdump I see routes.txt+calendar.txt has a mix of \r\n and \r,
stops.txt a mix of \r\n and \n, trips.txt \r\n, \n and \r etc.
Independent of the fact that this crashes the validator can someone suggest an
easy way to clean these up? My best idea is to load each in a spreadsheet and
export as csv again.
Original comment by tom.brow...@gmail.com
on 12 Jul 2010 at 5:46
Issue 244 has been merged into this issue.
Original comment by a...@google.com
on 30 Aug 2010 at 8:28
Issue 238 has been merged into this issue.
Original comment by bdfer...@google.com
on 26 Sep 2014 at 4:42
Issue 244 has been merged into this issue.
Original comment by bdfer...@google.com
on 26 Sep 2014 at 4:42
Moved to https://github.com/google/transitfeed/issues/107
Original comment by bdfer...@google.com
on 7 Oct 2014 at 7:59
Original issue reported on code.google.com by
tom.brow...@gmail.com
on 5 Nov 2008 at 11:45