Hi all,
I have a very messy variable from a survey I'm trying to clean up that consists of written-in amounts of money. The problem is that nearly all the respondents decided to write in the amounts of money in their own respective formats, so I have a collection of entries that consist of various combinations of $, USD, and the word "dollars." To do any work with this variable, I need to extract all the combinations of digits, commas and decimals that lie in a row, thus extracting the numbers of the amounts. I've used regular expressions before, but not for anything this messy -- is there easy way to do this?
Thanks,
Ben
I have a very messy variable from a survey I'm trying to clean up that consists of written-in amounts of money. The problem is that nearly all the respondents decided to write in the amounts of money in their own respective formats, so I have a collection of entries that consist of various combinations of $, USD, and the word "dollars." To do any work with this variable, I need to extract all the combinations of digits, commas and decimals that lie in a row, thus extracting the numbers of the amounts. I've used regular expressions before, but not for anything this messy -- is there easy way to do this?
Thanks,
Ben
Comment