Post Reopened by Jamal
5 deleted 203 characters in body
source | link

I need to update two columns 'feedID', 'OperatID': feedID and OperatID of table#1.csv with 'feed description', 'Operate description' from other csvCSV files. Please help me how to write a python script to achieve this.(FYI: I don't have the pandas module available) Thank you in advance :-).

enter image description here

enter code here

>>> import csv
>>> table1 = r'N:\Extracts\table1.csv'
>>> table2 = r'N:\Extracts\table2.csv'
>>> with open(table1,'r+')as f1:
...     f1reader = csv.reader(f1)
...     f1reader.next()
...     f1writer = csv.writer(f1)
...     for row in f1reader:
...         in_fdrid = row[2]
...         def get_fdrname(in_fdrid):
...             with open(table2,'rU')as f2:
...                 f2reader = csv.reader(f2)
...                 for f2row in f2reader:
...                     if in_fdrid == f2row[1]:
...                         fdrnm = f2row[2]
...                         return fdrnm
...             f2.close()
...         row[2].replace(in_fdrid,get_fdrname(in_fdrid))
...         
>>> 

I need to update two columns 'feedID', 'OperatID' of table#1.csv with 'feed description', 'Operate description' from other csv files. Please help me how to write a python script to achieve this.(FYI: I don't have pandas module available) Thank you in advance :-)enter image description here

enter code here

>>> import csv
>>> table1 = r'N:\Extracts\table1.csv'
>>> table2 = r'N:\Extracts\table2.csv'
>>> with open(table1,'r+')as f1:
...     f1reader = csv.reader(f1)
...     f1reader.next()
...     f1writer = csv.writer(f1)
...     for row in f1reader:
...         in_fdrid = row[2]
...         def get_fdrname(in_fdrid):
...             with open(table2,'rU')as f2:
...                 f2reader = csv.reader(f2)
...                 for f2row in f2reader:
...                     if in_fdrid == f2row[1]:
...                         fdrnm = f2row[2]
...                         return fdrnm
...             f2.close()
...         row[2].replace(in_fdrid,get_fdrname(in_fdrid))
...         
>>> 

I need to update two columns: feedID and OperatID of table#1.csv with 'feed description', 'Operate description' from other CSV files. I don't have the pandas module available.

enter image description here

import csv
table1 = r'N:\Extracts\table1.csv'
table2 = r'N:\Extracts\table2.csv'
with open(table1,'r+')as f1:
    f1reader = csv.reader(f1)
    f1reader.next()
    f1writer = csv.writer(f1)
    for row in f1reader:
        in_fdrid = row[2]
        def get_fdrname(in_fdrid):
            with open(table2,'rU')as f2:
                f2reader = csv.reader(f2)
                for f2row in f2reader:
                    if in_fdrid == f2row[1]:
                        fdrnm = f2row[2]
                        return fdrnm
            f2.close()
        row[2].replace(in_fdrid,get_fdrname(in_fdrid))
4 added 23 characters in body
source | link

I need to update two columns 'feedID', 'OperatID' of table#1.csv with 'feed description', 'Operate description' from other csv files. Please help me how to write a python script to achieve this.(FYI: I don't have pandas module available) Thank you in advance :-)enter image description here

enter code here 

>>> import csv
>>> table1 = r'N:\Extracts\table1.csv'
>>> table2 = r'N:\Extracts\table2.csv'
>>> with open(table1,'r+')as f1:
...     f1reader = csv.reader(f1)
...     f1reader.next()
...     f1writer = csv.writer(f1)
...     for row in f1reader:
...         in_fdrid = row[2]
...         def get_fdrname(in_fdrid):
...             with open(table2,'rU')as f2:
...                 f2reader = csv.reader(f2)
...                 for f2row in f2reader:
...                     if in_fdrid == f2row[1]:
...                         fdrnm = f2row[2]
...                         return fdrnm
...             f2.close()
...         row[2].replace(in_fdrid,get_fdrname(in_fdrid))
...         
>>> 

I need to update two columns 'feedID', 'OperatID' of table#1.csv with 'feed description', 'Operate description' from other csv files. Please help me how to write a python script to achieve this.(FYI: I don't have pandas module available) Thank you in advance :-)enter image description here

enter code here

I need to update two columns 'feedID', 'OperatID' of table#1.csv with 'feed description', 'Operate description' from other csv files. Please help me how to write a python script to achieve this.(FYI: I don't have pandas module available) Thank you in advance :-)enter image description here

enter code here 

>>> import csv
>>> table1 = r'N:\Extracts\table1.csv'
>>> table2 = r'N:\Extracts\table2.csv'
>>> with open(table1,'r+')as f1:
...     f1reader = csv.reader(f1)
...     f1reader.next()
...     f1writer = csv.writer(f1)
...     for row in f1reader:
...         in_fdrid = row[2]
...         def get_fdrname(in_fdrid):
...             with open(table2,'rU')as f2:
...                 f2reader = csv.reader(f2)
...                 for f2row in f2reader:
...                     if in_fdrid == f2row[1]:
...                         fdrnm = f2row[2]
...                         return fdrnm
...             f2.close()
...         row[2].replace(in_fdrid,get_fdrname(in_fdrid))
...         
>>> 
3 added 23 characters in body
source | link

enter image description hereI I need to update two columns 'feedID', 'OperatID' of table#1.csv with 'feed description', 'Operate description' from other csv files. Please help me how to write a python script to achieve this.(FYI: I don't have pandas module available) Thank you in advance :-)enter image description here

enter code here

enter image description hereI need to update two columns 'feedID', 'OperatID' of table#1.csv with 'feed description', 'Operate description' from other csv files. Please help me how to write a python script to achieve this.(FYI: I don't have pandas module available) Thank you in advance :-)enter image description here

I need to update two columns 'feedID', 'OperatID' of table#1.csv with 'feed description', 'Operate description' from other csv files. Please help me how to write a python script to achieve this.(FYI: I don't have pandas module available) Thank you in advance :-)enter image description here

enter code here
2 added 83 characters in body; edited tags
source | link
    Post Closed as "off-topic" by Jamal
1
source | link