步驟1:於TABLE表內新增兩欄位(ADD FIELD)為「Field_1」、「Field_2」,選擇Text格式
Step 1: Add two fields to the TABLE table, named ‘Field_1’ and ‘Field_2’, and select the ‘text’ format.
步驟2:於「Field_1」欄位,利用FIELD CALCULATOR計算需要的欄位內容
Step 2:Using the FIELD CALCULATOR, calculate the desired field content for the ‘Field_1’ column.
步驟3:假設需要拆分符號前的資料,Parser 選擇「Python」,於下列方框寫入計算式 → 點選上方「Field」框,點擊 Field(基礎計算欄位),Type 選擇「String」並點擊.split,於括號內鍵入「"-"」,並於最後鍵入「[0]」,點選「OK」即可。
Step 3: If you need to extract the data before the split symbol, select ‘Python’ as the parser. In the box below, enter the following calculation: Click on the ‘Field’ box above, then click ‘Field’ (the base calculation field). Select ‘String’ as the type, then click ‘.split’. Inside the parentheses, type ‘-’ and type ‘[0]’ at the end. Click ‘OK’ to finish.
步驟4:假設需要拆分符號後的資料,同步驟三,並於程式碼最後鍵入「[1]」,點選「OK」即可。
Step 4: If you need to extract the data after the split symbol, follow the same steps as in Step 3, but add ‘[1]’ to the end of the code. Click ‘OK’ to execute the calculation.
ArcGIS 10.x - Field Calculator - Split String - get First or Secont value of splitted string