How can I write a find and replace macro to merge many items in few, as "USA, Mexico, Canada, Honduras" in "America", "China, India, Vietnam" in "Asia" and so.
Before macro: USA, Mexico, Canada, Honduras
After macro: America, America, America, America
You can use the lookup function in Calc to do this.
Documentation here: https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_LOOKUP_function
you need your data in columns for this to work, then you would do something like:
LOOKUP(3; A1:E1; A3:E3)
for each row in the data.