J. Clifford Dyer a écrit :
> On Thu, Sep 27, 2007 at 09:50:26PM +0200, Bruno Desthuilliers wrote
> regarding Re: ValueError: too many values to unpack,>>>:
>> Shawn Minisall a ?crit :
(snip)
>>> I did and it printed everything up until the 3rd line with 3
>>&
Zentrader wrote:
> On Sep 27, 9:46 am, Shawn Minisall <[EMAIL PROTECTED]> wrote:
>
>> line 3 - 19.1829.1578.75212.10
>> line 4 - 10020410.29
>> And this is the code I'm using:
>>
>>#read withdrawls from file on line3
>>line = infile.readline()
>> #split withdrawl
On Sep 27, 9:46 am, Shawn Minisall <[EMAIL PROTECTED]> wrote:
> I am trying to read a few lines of a file with multiple values, the rest
> are single and are reading in fine.
>
> With the multiple value lines, python says this "ValueError: too many
> values to unpack"
>
> I've googled it and it say
On Thu, Sep 27, 2007 at 09:50:26PM +0200, Bruno Desthuilliers wrote regarding
Re: ValueError: too many values to unpack,>>>:
>
> Shawn Minisall a ?crit :
> > Fredrik Lundh wrote:
> >
> >> Shawn Minisall wrote:
> >>
> >>
> >>
>
Shawn Minisall wrote:
> Fredrik Lundh wrote:
>> Shawn Minisall wrote:
>>
>>
>>> Sorry, it looks like it's on the fourth line with the 3 values on line
>>> 4...its reading line 3 fine
>>>
>>> Traceback (most recent call last):
>>> File "", line 1, in
>>> main()
>>> File "I:\COMPUTER PRO
On Sep 27, 12:46 pm, Shawn Minisall <[EMAIL PROTECTED]> wrote:
> I am trying to read a few lines of a file with multiple values, the rest
> are single and are reading in fine.
>
> With the multiple value lines, python says this "ValueError: too many
> values to unpack"
>
> I've googled it and it sa
Shawn Minisall a écrit :
> Fredrik Lundh wrote:
>
>> Shawn Minisall wrote:
>>
>>
>>
>>> Sorry, it looks like it's on the fourth line with the 3 values on
>>> line 4...its reading line 3 fine
>>>
>>> Traceback (most recent call last):
>>> File "", line 1, in
>>> main()
>>> File "I:\COMP
Fredrik Lundh wrote:
> Shawn Minisall wrote:
>
>
>> Sorry, it looks like it's on the fourth line with the 3 values on line
>> 4...its reading line 3 fine
>>
>> Traceback (most recent call last):
>> File "", line 1, in
>> main()
>> File "I:\COMPUTER PROGRAMMING CLASS\PROJECT #1\project1
Shawn Minisall wrote:
> Sorry, it looks like it's on the fourth line with the 3 values on line
> 4...its reading line 3 fine
>
> Traceback (most recent call last):
> File "", line 1, in
> main()
> File "I:\COMPUTER PROGRAMMING CLASS\PROJECT #1\project1.py", line 33,
> in main
> dep
Marc 'BlackJack' Rintsch wrote:
> On Thu, 27 Sep 2007 12:36:58 -0400, Shawn Minisall wrote:
>
>
>> With the multiple value lines, python says this "ValueError: too many
>> values to unpack"
>>
>> I've googled it and it says that happens when you have too few or too
>> many strings that don't m
On Thu, 27 Sep 2007 12:36:58 -0400, Shawn Minisall wrote:
> With the multiple value lines, python says this "ValueError: too many
> values to unpack"
>
> I've googled it and it says that happens when you have too few or too
> many strings that don't match with the variables in number your tryin
Laszlo Nagy a écrit :
(snip)
> Try this instead:
>
> lineno = 0
> for values in csvreader:
>try:
> lineno += 1
Laszlo, may I suggest using enumerate() here instead ?-)
for lineno, row in enumerate(csvreader):
print "line %s" % lineno+1 # want 1-based numbering
--
http://mail.python
You guys have given me some great ideas, I am going to try them all
out and let you guys know how it turns out.
On a side note, thanks for nto bashing a noob like me who isn't the
greatest pythonista around. I am trying to learn and you guys are how
I learn my mistakes. Well you, and the fact the
On Apr 12, 5:28 am, "fscked" <[EMAIL PROTECTED]> wrote:
> On Apr 11, 10:26 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote:
>
>
>
> > fscked írta:> Trying to use CSV to read in a line with 11 fields and I keep
> > getting
> > > this error. I have googled a bit and have been unable to figure it out.
>
>
En Wed, 11 Apr 2007 16:28:08 -0300, fscked <[EMAIL PROTECTED]>
escribió:
>> Trying to use CSV to read in a line with 11 fields and I keep getting
>> this error. I have googled a bit and have been unable to figure it
>
> myfile = open('ClientsXMLUpdate.csv')
> csvreader = csv.reader(myfile)
>
> f
> Hmm, well I have counted the fields in the CSV and verified there are
> only 11. Here is the offending code:
>
>
Try this instead:
lineno = 0
for values in csvreader:
try:
lineno += 1
boxid, mac, activated, hw_ver, sw_ver, heartbeat, name,
address,phone, country, ci
On Apr 11, 10:26 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote:
> fscked írta:> Trying to use CSV to read in a line with 11 fields and I keep
> getting
> > this error. I have googled a bit and have been unable to figure it out.
>
> Probably you have more than 11 values in some (or all) of the rows in
fscked írta:
> Trying to use CSV to read in a line with 11 fields and I keep getting
> this error. I have googled a bit and have been unable to figure it out.
>
>
Probably you have more than 11 values in some (or all) of the rows in
the CSV file. Try this code:
L = (1,2,3,4,5)
a1,a2,a3 = L
If
That happens when you try something like this:
a,b,c = [1,2,3,4]
It means there are more items on the right side than the left. You
probably have < 11 variables on the left side.
On Apr 11, 10:13 am, "fscked" <[EMAIL PROTECTED]> wrote:
> Trying to use CSV to read in a line with 11 fields and I
Thank you, that solved my problem.
Thanks
Retheesh
alisonken1 wrote:
> [EMAIL PROTECTED] wrote:
>
> > 56 records were different
> > Type, FileType,
> >Item,
> > Hash,
> >
> > Path, Size, CullCd, Ext, DtCr,
[EMAIL PROTECTED] wrote:
> 56 records were different
> Type, FileType,
>Item,
> Hash,
>
> Path, Size, CullCd, Ext, DtCr,
> DtLMd, DtLAc
> Traceback (most recent call last
21 matches
Mail list logo