{{ transformations:ReplaceAction.png}} ====== REPLACE ====== Category: Transform / Basic\\ \\ =====Description===== This action replaces particular values in a column with new values. The new values can be either text or numbers. Multiple old values can be replaced with the same new value.\\ \\ =====Use cases===== *Replace mistyped names and words with correct ones. *Replace long text values with abbreviations. *Replace empty cells with 0. \\ =====Action settings===== ^Setting^Description^ |Column|Select the column in which values will be replaced.| |Before / After|Select the value(s) to be replaced and enter the new values in the text boxes that appear to the right.| |If a value to be replaced is missing|Select how EasyMorph will react if a selected value is not in the selected column.\\ Options: //Fail// (An error will be displayed for his action.) or //Ignore// (missing values will be skipped and the action will replace existing values.).| |Show missing|This option only appears when //Ignore// is selected for the //If a value to be replaced is missing// option, above.\\ The Before/After list will display the selected values that are missing in the column.| The //search box// can be used to find a specific value in large value lists. \\ =====Remarks===== Only //whole// values are replaced with this action, not partial matches. If used with the [[transformations:sequence|Sequence]] transformation, it allows defining relatively small custom lists. Use Replace to replace 1 with one custom value, 2 with another one, etc.\\ \\ =====Examples===== ====Example #1==== >Expand the names of the "America" values ("N." to "North", "S." to "South"). ===Before (source table)=== ^River ^Length (km) ^Continent ^ | Nile | 6650|Africa | | Amazon | 6400|S. America | | Yangtze | 6300|Asia | | Mississippi | 6275|N. America | ===After (result table)=== ^River ^Length (km) ^Continent ^ | Nile | 6650|Africa | | Amazon | 6400|**South America** | | Yangtze | 6300|Asia | | Mississippi | 6275|**North America** | ===Action parameters:=== > Column: Continent > (Before) N. America: (After) North America > (Before) S. America: (After) South America \\ =====Community examples===== * [[https://community.easymorph.com/t//1590/4|Puzzler: derived column from two columns]] ([[https://community.easymorph.com/uploads/short-url/5OvCYyhfiaCg5XZU3nALaT5eql4.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 1//; Action position: //5//) * [[https://community.easymorph.com/t//1972/2|Read Data with two line header]] ([[https://community.easymorph.com/uploads/short-url/4YFQxslIv3pmgtF2eRywf4wpcFQ.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Read, Mark groups//; Action position: //7//) * [[https://community.easymorph.com/t//2060/2|Search, remove, and shift]] ([[https://community.easymorph.com/uploads/short-url/cCqOTak9SLKPXbityR5IAlgULJa.morph|Project]]; Module: //Main//; Group: //Regrouping//; Table: //ExtractingData.xlsx//; Action position: //6//) \\ =====Shortcuts===== Fast ways to create the action:\\ *Right-click on the value to replace in a dataset and select "Replace (value)...". \\ =====See also===== * [[transformations:replacewithlookup|Replace with lookup]] * [[transformations:lookup|Lookup]] * [[transformations:rule|Rule]]