Sum the values of column matching and not matching from a .txt file and write output to a two different files using Python

+1 vote
Name                                                    value

DR_CNDAOFSZAPZP_GPFS_VOL.0 139264

DR_CNDAOFSZAPZP_GPFS_VOL.1 15657

DR_CNDAOFSZAPZP_GPFS_VOL.0 139264

DR_CNDAOFSZAPZP_GPFS_VOL.1 156579

DR_CNDAOFSZAPZP_GPFS_VOL.2 156579

DR_CNDAOFSZAPZP_GPFS_VOL.3 156579

DR_CNDAOFSZAPZP_GPFS_VOL.5 172236

Output1

     Name                                                  \Value

DR_CNDAOFSZAPZP_GPFS_VOL.0 278528

DR_CNDAOFSZAPZP_GPFS_VOL.1 172236

Output2 with out matching names

DR_CNDAOFSZAPZP_GPFS_VOL.2 156579

DR_CNDAOFSZAPZP_GPFS_VOL.3 156579

DR_CNDAOFSZAPZP_GPFS_VOL.5 172236
Nov 20, 2019 in Python by Sagar
• 130 points
446 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
2 answers
+1 vote
1 answer
0 votes
1 answer

How to list a column of float values from csv file without importing (Python)

Using the default CSV module Demo: import csv with open(filename, "r") ...READ MORE

answered Sep 16 in Python by Rajiv
• 4,680 points
490 views
0 votes
1 answer

How to find the value of a row in a csv file in python and print column and row of that value ?

Hello @Khanhh , Use panda to find the value of ...READ MORE

answered Oct 15 in Python by Niroj
• 76,940 points
189 views
0 votes
1 answer

How to use read a WSDL file from the file system using Python suds?

Hi, good question. It is a very simple ...READ MORE

answered Jan 21, 2019 in Python by Nymeria
• 3,520 points
3,015 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,560 views
0 votes
0 answers