Jan-14-2019, 06:09 PM
cool brother. What about if the string start with JC-PENNY
EX: JCPenney CC JCPTELPAY 092818 1688660513N6008895915763857 - THIS IS ONE STRING ...
for every instance we cant write all functions. so my thinking is I have 800 merchants .. want to scan each row like sql like operator ..
case
when substr(upper(TRAN_STMT_DESC),1,16) IN ('ACORNS.COM ', 'ACORNS INVESTMEN') then 'ACORNS'
when substr(upper(TRAN_STMT_DESC),1,16) ='ACS EXPRESS PAY ' then 'ACS'
when substr(upper(TRAN_STMT_DESC),1,16) ='ACS' then 'ACS'
when substr(upper(TRAN_STMT_DESC),1,4) ='AD&D' then 'AD&D'
when substr(upper(TRAN_STMT_DESC),1,16) ='ADP PAYROLL FEES' then 'ADP'
when substr(upper(TRAN_STMT_DESC),1,16) ='ADP TX/FINCL SVC' then 'ADP'
when substr(upper(TRAN_STMT_DESC),1,12) ='ADT SECURITY' then 'ADT SECURITY'
when substr(upper(TRAN_STMT_DESC),1,16) ='AES ' then 'AES'
when substr(upper(TRAN_STMT_DESC),1,06) ='AFLAC ' then 'AFLAC'
when substr(upper(TRAN_STMT_DESC),1,15) ='ALLIED' then 'ALLIED'
when substr(upper(TRAN_STMT_DESC),1,8) = 'ALLSTATE' then 'ALLSTATE'
when substr(upper(TRAN_STMT_DESC),1,05) ='ALLY 'then 'ALLY Bank/Financial'
when substr(upper(TRAN_STMT_DESC),1,16) ='AM INCOME LIFE ' then 'AM INCOME LIFE'
when ( substr(upper(TRAN_STMT_DESC),1,6) = 'AMAZON' OR substr(upper(TRAN_STMT_DESC),1,15)= 'PAYMENT FOR AMZ' OR substr(upper(TRAN_STMT_DESC),9,6) = 'AMAZON') then 'AMAZON'
when substr(upper(TRAN_STMT_DESC),1,15) ='AMERICAN FAMILY' then 'AMERICAN FAMILY'
when substr(upper(TRAN_STMT_DESC),1,16) ='AMERICAN FUNDS ' then 'AMERICAN FUNDS'
when substr(upper(TRAN_STMT_DESC),1,16) ='AMERICAN GEN LIF' then 'AMERICAN GEN LIF INS'
when substr(upper(TRAN_STMT_DESC),1,16) ='AMERICAN GENERAL' then 'AMERICAN GENERAL'
can this we implement in Python..
actually i am 5 days baby to python , so asking so many questions sorry for that...
my goal: is want to bring terdata table into python .. scan a row and parse the column(remove unwanted data) and send that parsed data into a table ..
EX: JCPenney CC JCPTELPAY 092818 1688660513N6008895915763857 - THIS IS ONE STRING ...
for every instance we cant write all functions. so my thinking is I have 800 merchants .. want to scan each row like sql like operator ..
case
when substr(upper(TRAN_STMT_DESC),1,16) IN ('ACORNS.COM ', 'ACORNS INVESTMEN') then 'ACORNS'
when substr(upper(TRAN_STMT_DESC),1,16) ='ACS EXPRESS PAY ' then 'ACS'
when substr(upper(TRAN_STMT_DESC),1,16) ='ACS' then 'ACS'
when substr(upper(TRAN_STMT_DESC),1,4) ='AD&D' then 'AD&D'
when substr(upper(TRAN_STMT_DESC),1,16) ='ADP PAYROLL FEES' then 'ADP'
when substr(upper(TRAN_STMT_DESC),1,16) ='ADP TX/FINCL SVC' then 'ADP'
when substr(upper(TRAN_STMT_DESC),1,12) ='ADT SECURITY' then 'ADT SECURITY'
when substr(upper(TRAN_STMT_DESC),1,16) ='AES ' then 'AES'
when substr(upper(TRAN_STMT_DESC),1,06) ='AFLAC ' then 'AFLAC'
when substr(upper(TRAN_STMT_DESC),1,15) ='ALLIED' then 'ALLIED'
when substr(upper(TRAN_STMT_DESC),1,8) = 'ALLSTATE' then 'ALLSTATE'
when substr(upper(TRAN_STMT_DESC),1,05) ='ALLY 'then 'ALLY Bank/Financial'
when substr(upper(TRAN_STMT_DESC),1,16) ='AM INCOME LIFE ' then 'AM INCOME LIFE'
when ( substr(upper(TRAN_STMT_DESC),1,6) = 'AMAZON' OR substr(upper(TRAN_STMT_DESC),1,15)= 'PAYMENT FOR AMZ' OR substr(upper(TRAN_STMT_DESC),9,6) = 'AMAZON') then 'AMAZON'
when substr(upper(TRAN_STMT_DESC),1,15) ='AMERICAN FAMILY' then 'AMERICAN FAMILY'
when substr(upper(TRAN_STMT_DESC),1,16) ='AMERICAN FUNDS ' then 'AMERICAN FUNDS'
when substr(upper(TRAN_STMT_DESC),1,16) ='AMERICAN GEN LIF' then 'AMERICAN GEN LIF INS'
when substr(upper(TRAN_STMT_DESC),1,16) ='AMERICAN GENERAL' then 'AMERICAN GENERAL'
can this we implement in Python..
actually i am 5 days baby to python , so asking so many questions sorry for that...
my goal: is want to bring terdata table into python .. scan a row and parse the column(remove unwanted data) and send that parsed data into a table ..