Regular Expression Find and Replace
Posted on 2011-10-18
I have rows of data that look similar to this (2 fields- an English phrase and a Spanish phrase)
"$10 for the first 20 people, $5 for all following attendees", "$10 la primera 20 personas, $5 para los demas participantes"
"$20 for the first 20 people, $0 for all following attendees", "$20 la primera 20 personas,$0 para los demas participantes"
"$30 for the first 50 people, $1.50 for all following attendees", "$30 la primera 50 personas,$1.50 para los demas participantes"
I add a row to the table whenever a new previously unused phrase comes in- such as:
$2.50 for the first 2 people, $1.00 for all following attendees"
Since this is a phrase that I have already translated before (minus the numeric differences)- I want to be able to create the similar Spanish phrase for the new value by simply subsituting the new numeric values into a similar Spanish phrase- so for this new example, it would be "$2.50 la primera 2 personas,$1.00 para los demas participantes"
So basically, I need to be able to compare new English phrases that arrive in a file with all of the English phrases that I already have in my table and see if there is a match on everything but the numeric values (although the numeric values have to be in the same position) and if there is, update the numeric values of the corresponding Spanish phrase to match.