Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Error: too many values to unpack
Post: Error: too many values to unpack

Hello, I have a script that should open external ascii file, take the first two columns, add each row and output file with first two columns with sum as a third column. I have a quite big (1.6 Mb) dat...
Mike General Coding Help 1 5,143 Oct-30-2019, 02:57 PM
    Thread: Doing calculation with ascii file
Post: RE: Doing calculation with ascii file

Thanks! Although a bit confusing is the header separating-adding thing.
Mike General Coding Help 5 2,667 Oct-02-2019, 02:16 PM
    Thread: Doing calculation with ascii file
Post: RE: Doing calculation with ascii file

I guess I solved my problem. Here is the script: with open('file.txt',"r") as in_file, open('file2.txt',"w") as out_file: next(in_file) for line in in_file: line = line.strip() num1, num2 = line...
Mike General Coding Help 5 2,667 Oct-02-2019, 01:34 PM
    Thread: Doing calculation with ascii file
Post: RE: Doing calculation with ascii file

Thank you! Tried Your solution and it works. Added lines: num3 = num1 + num2 print(num1,num2,num3)Which gives the first row: Output:324,234,803Now somehow have to append (?) it and use FOR cycle to ...
Mike General Coding Help 5 2,667 Oct-02-2019, 12:17 PM
    Thread: Doing calculation with ascii file
Post: Doing calculation with ascii file

Hello! I have file named DATA.TXT which contains: Output:colA,colB 324,234 346,341 147,346 234,567 368,405 344,643 235,235 236,567I am trying to read this in using line-by-line (for learning purpose)...
Mike General Coding Help 5 2,667 Oct-02-2019, 11:09 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020