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
295 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
1 answer
+1 vote
1 answer
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,540 points
1,930 views
0 votes
0 answers
0 votes
1 answer

Write code to create a list of word lengths for the words in original_str using the accumulation pattern and assign the answer to a variable num_words_list.

Hi,  num_words_list = len(original_str.split()) original_str.split() - split words in ...READ MORE

answered May 27 in Python by Niroj
• 32,440 points
354 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,052 views
0 votes
0 answers