[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eThis content outlines how to extract data from a field within the Wrangler workspace of Cloud Data Fusion Studio, preparing data for transformation.\u003c/p\u003e\n"],["\u003cp\u003eData extraction in Wrangler can be done using predefined patterns like email, URL, date, credit card, etc., allowing for the creation of new columns from these extracted values.\u003c/p\u003e\n"],["\u003cp\u003eData can be extracted by splitting columns based on delimiters such as commas, tabs, or custom separators, enabling the division of data into multiple new columns.\u003c/p\u003e\n"],["\u003cp\u003eWrangler also offers the ability to extract data based on the position of characters within a string, providing flexibility in isolating specific parts of the data.\u003c/p\u003e\n"],["\u003cp\u003eAfter each extraction operation, Wrangler adds a specific directive to the data recipe, and upon pipeline execution, these transformations are applied to all rows in the respective column by Cloud Data Fusion.\u003c/p\u003e\n"]]],[],null,["# Extract data from fields\n\nThis page explains how to extract and transform data from a field (a cell) when\nyou prepare data in the Wrangler workspace of the Cloud Data Fusion Studio.\n\nTo perform transformations on this data, you split it into separate\ncolumns. In Wrangler, you can extract data from a column and create new\ncolumns for the extracted data. You can extract values based on patterns,\ndelimiters, or positions.\n\nExtract data using patterns\n---------------------------\n\nYou can extract data from fields in columns of the string data type with the\nfollowing patterns:\n\n- Credit cards\n- Date\n- Date time\n- Email\n- URLs from HTML anchors\n- IPv4 address\n- ISBN codes\n- Mac address\n- N digits number\n- SSN\n- Start and End pattern\n- Time\n\nTo extract data based on a pattern, follow these steps:\n\n1. [Go to Wrangler workspace in Cloud Data Fusion](/data-fusion/docs/concepts/wrangler-overview#navigate-to-wrangler).\n2. On the **Data** tab, go to a column name and click the arrow_drop_down expander arrow.\n3. Select **Extract fields \\\u003e Using patterns** and select an option---for example, **URL**.\n4. Optional: click **Show pattern** to view the regular expression for the pattern.\n5. Click **Extract**.\n\nWrangler extracts the fields based on the chosen pattern and adds the\n`extract-regex-groups` directive to the recipe. When you run the data pipeline,\nCloud Data Fusion applies the transformation to all rows in the column.\n\nIn the following example, a column contains a number, followed by an email address:\n\nTo extract the email address, select the **Email** pattern. When you click\n**Extract**, Wrangler retains the original column and creates a new column\ncontaining only the email addresses:\n\nExtract data with delimiters\n----------------------------\n\nYou can extract data into two or more columns based on the following\ndelimiters:\n\n- Comma\n- Tab\n- Pipe\n- Whitespace\n- Custom separator\n\n| **Note:** If you select the **Custom separator** option, define the delimiter with a regular expression. It supports standard Java regular expression constructs.\n\nIf a value doesn't have the delimiter, no value is added to corresponding field\nin the new column.\n\nTo extract values based on a delimiter:\n\n1. [Go to Wrangler workspace in Cloud Data Fusion](/data-fusion/docs/concepts/wrangler-overview#navigate-to-wrangler).\n2. On the **Data** tab, go to a column name and click the arrow_drop_down expander arrow.\n3. Select **Extract fields \\\u003e Using delimiters** and select an option---for example, **Comma**.\n4. Click **Extract**.\n\nWrangler extracts the fields based on the selected delimiter and adds the\n`split-to-columns` directive to the recipe. When you run the data pipeline,\nCloud Data Fusion transforms all values in the column.\n\nIn the following example, a column contains multiple names separated by commas:\n\nIn this example, using the comma delimiters pattern extracts the values in the\noriginal `Name` column into three new columns:\n\nExtract data by position\n------------------------\n\nYou can extract part of a string based on its position in the string.\n\nTo extract data based on its position:\n\n1. [Go to Wrangler workspace in Cloud Data Fusion](/data-fusion/docs/concepts/wrangler-overview#navigate-to-wrangler).\n2. On the **Data** tab, go to a column name and click the arrow_drop_down expander arrow.\n3. Select **Extract fields \\\u003e Using positions**. Column values you can extract appear with a blue background.\n4. In any cell of the column, select the characters to extract.\n5. In the **Name of destination column** field, enter a name.\n6. Click **Apply**.\n\nThe chosen portion of the value is extracted from each row in the column.\n\nWrangler extracts the fields based on the selected pattern and adds the\n`cut-character` directive to the recipe. When you run the data pipeline,\nCloud Data Fusion applies the transformation to all values in the column.\n\nWhat's next\n-----------\n\n- Learn more about [Wrangler directives](/data-fusion/docs/concepts/wrangler-overview#apply_directives)."]]