473,384 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,384 software developers and data experts.

CSV ignores lineterminator

With

input_data = ['word1\tword2;word3\tword4;',
'word5\tword6;word7\tword8;']

and

delimiter = '\t'
lineterminator = ';'

shouldn't csv.reader(input_data, dialect='mydialect') return

['word1', 'word2']

as the first row? I find that it doesn't matter how I set
lineterminator, csv always terminates at the end of the line returned
by the iterable object passed as its first argument (input_data, in
this case). I must be missing something basic here.

I may be confused about the interaction between what iterable object
defines as the next row and what csv.reader defines as the next row.
The documentation for csv says that the line returned by csv.reader can
span multiple input lines. I assume that this would happen if the
lineterminator is defined as something other than \n, in which case
csv.reader would keep pulling in lines until it finds the
lineterminator. This is not the behavior I am observing.

I'm using Python 2.3 on Linux 2.4.23.
--
Jeffrey Barish
Jul 18 '05 #1
0 963

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Teuvo Eloranta | last post by:
Hi, I have a question regarding csv module usage in W2K (ActivePython-2.3.2-232-win32-ix86) http://www.python.org/doc/current/lib/csv-fmt-params.html says: "lineterminator The string used to...
3
by: googlegroups | last post by:
Here is the HTML I am trying to get working. In firefox, the HTML fills the entire window with a scrollbar in the red div. I can resize the page and the page is still completely filled. However,...
2
by: L Mehl | last post by:
Hello -- Sometimes the code editor ignores the spacebar, and requires me to cursor through the line, after entering it, and hit the spacebar where I need a space. Has anyone experienced this?...
0
by: Rokas Valantinas | last post by:
Hi, After deploying ASP.NET webservices to clients testing environment, some problems occured with assembly versioning. Exception log showed that CLR ignores <bindingRedirect> tag and it's...
3
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition...
1
by: itmanager | last post by:
I am trying to create a process at a particular set of coordinates (for example 1,1) but the CreateProcess api seemingly ignores the settings in the dwX and dwY properties of the STARTUPINFO...
3
by: Ben R. | last post by:
Seems like CreateUserWizard flat out ignores StartNavigationTemplate. Not sure why the designer bothers to offer for you to edit it, but even when you specifiy this, it doesn't seem to be used. Is...
0
by: No_Name | last post by:
I created a very simple CSS for printing. It works fine in IE and Firefox but not Netscape or Mozilla by because it ignores the margin and font size. It also prints the header/footer (URL, page,...
5
by: turnitup | last post by:
I have a security mechanism that checks that session variables are set, and if not, redirects. It seems, however, that CURL just ignores this statement and completely breaches my security. Does...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.