I am trying to import csv files from my bank. The problem is the csv file shows negative values (expenses) with one minus sign and positive values (income) with two minus signs. When they are imported they all come in as expenses. Here is an example of my csv:
posted,,12/31/2018,,INTEREST PAID,Interest,--0.03
posted,,11/30/2018,,INTEREST PAID,Interest,--0.03
posted,,10/31/2018,,INTEREST PAID,Interest,--0.03
posted,,09/28/2018,,INTEREST PAID,Interest,--0.03
posted,,08/31/2018,,INTEREST PAID,Interest,--0.03
posted,,07/31/2018,,INTEREST PAID,Interest,--0.05
posted,,07/23/2018,,USAA FUNDS TRANSFER DB,Transfers,-200
posted,,07/03/2018,,USAA FUNDS TRANSFER DB,Transfers,-1000
How do I convert the values with a double minus to income? I am guessing that there is a Regex that I can use, but that is beyond my ability. Can you help?
"?(?:--){0,1}(?.?)"?(?:[,]|\Z)(?(.|\Z))
regex are hard. I am sorry, I did not see any email for issues.
it looks like adding (?:--){0,1} in above takes out any -- which will make it positive.
so "15" -> "15" "-15" -> "-15" "--15" -> "15"
i found this regex tester that is helpful!
I am trying to import csv files from my bank. The problem is the csv file shows negative values (expenses) with one minus sign and positive values (income) with two minus signs. When they are imported they all come in as expenses. Here is an example of my csv: posted,,12/31/2018,,INTEREST PAID,Interest,--0.03 posted,,11/30/2018,,INTEREST PAID,Interest,--0.03 posted,,10/31/2018,,INTEREST PAID,Interest,--0.03 posted,,09/28/2018,,INTEREST PAID,Interest,--0.03 posted,,08/31/2018,,INTEREST PAID,Interest,--0.03 posted,,07/31/2018,,INTEREST PAID,Interest,--0.05 posted,,07/23/2018,,USAA FUNDS TRANSFER DB,Transfers,-200 posted,,07/03/2018,,USAA FUNDS TRANSFER DB,Transfers,-1000 How do I convert the values with a double minus to income? I am guessing that there is a Regex that I can use, but that is beyond my ability. Can you help?