Ok, I'm trying to do the simplest read/write from one csv file to
another. For some reason, every other row on the output file is a
blank row. What am I doing wrong?
import csv
reader = csv.reader(open('current.csv'))
writer = csv.writer(open('new.csv','w'))
for line in reader:
writer.writerow(line) 2 1991
On 25/04/2007 8:27 AM, Drew wrote:
Ok, I'm trying to do the simplest read/write from one csv file to
another. For some reason, every other row on the output file is a
blank row. What am I doing wrong?
import csv
reader = csv.reader(open('current.csv'))
writer = csv.writer(open('new.csv','w'))
for line in reader:
writer.writerow(line)
1. Try reading the responses already posted to your previous questions.
2. Try reading the documentation; for each of csv.reader and csv.writer,
it says "If csvfile is a file object, it must be opened with the 'b'
flag on platforms where that makes a difference."
On Apr 24, 8:35 pm, John Machin <sjmac...@lexicon.netwrote:
On 25/04/2007 8:27 AM, Drew wrote:
Ok, I'm trying to do the simplest read/write from one csv file to
another. For some reason, every other row on the output file is a
blank row. What am I doing wrong?
import csv
reader = csv.reader(open('current.csv'))
writer = csv.writer(open('new.csv','w'))
for line in reader:
writer.writerow(line)
1. Try reading the responses already posted to your previous questions.
2. Try reading the documentation; for each of csv.reader and csv.writer,
it says "If csvfile is a file object, it must be opened with the 'b'
flag on platforms where that makes a difference."
My apologies to the rest of the list, issues with groups.google.com
cause the multiple posts. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Fabrice Cavarretta |
last post by:
I am using a specialized database software (for bibliography: EndNote)
that does export in XML.
I would like to be able to read that into a simple software, like
Excel or Access, in order to do...
|
by: Randell D. |
last post by:
HELP!
I am determined to stick with this... I'm getting there... for those who
haven't read my earlier posts, I'm createing what should be a simple
function that I can call to check that...
|
by: Kenny ODell |
last post by:
I am struggling a bit with XML, even as I wade through endless help files and
several books. I thought it would be useful to toss my particular needs to
the group to see what you think is the best...
|
by: Daniel Sélen Secches |
last post by:
I found a good class to do a simple FTP.
Very good....
I'm posting it with the message, i hope it helps someone
==============================================================
Imports...
|
by: Harley |
last post by:
Hello,
I am just learning the tcp/ip functions etc under vb.net so please
look over me if this is obviouse. I have been all over looking into
any functions that I didn't totaly understand and...
|
by: Sehboo |
last post by:
Hi,
I want to write a very very simple mail application which my father can
use (maybe then I will be able to send and receive emails from him).
This application will have a text box, where he...
|
by: iwdu15 |
last post by:
hey, i was wondering if 1) anyone could tell me whats wrong with my code, i
did a little fixing to the msdn version fo this, or 2) how to make a simple
program that will connect and listen for...
|
by: rich |
last post by:
Hi all,
I have a fairly complex "feed" application that recieves messages from
an external user-supplied API via a callback function, and attempts to
forward these messages to another...
|
by: newsaboutgod |
last post by:
I think VB.NET drives some people crazy because some simple VB6 things
seem so hard.
Here is some VB6 code:
'Write CSV File
open "c:\test.csv" for output as #1
write#1, "1","2","3","4","5"...
|
by: jerry |
last post by:
i have written a simple phonebook program,i'll show you some of the
codes,the program's head file is member.h . i suppose the head file
works well.so i don't post it. here's the clips of main...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |