User Tools

Site Tools


transformations:splitfixedwidthtext

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
transformations:splitfixedwidthtext [2018/07/22 16:16] – created dmitrytransformations:splitfixedwidthtext [2021/08/14 21:47] (current) – [Action settings] craigt
Line 1: Line 1:
-===== Split fixed width text =====+{{ transformations:SplitFixedWidthTextAction.png}} 
 +======SPLIT FIXED WIDTH TEXT====== 
 +Category: Transform / Advanced \\
  
-This action splits text values of selected column into multiple columns of values of specified length. It is similar to the [[transformations:importfixedwidthtext|"Import fixed width text"]] action with the difference that it works with already loaded dataset.+\\  
 +=====Description===== 
 +This action splits text values of the selected column into multiple columns of values of specified lengths. It is similar to the [[transformations:importfixedwidthtext|Import fixed width text]] action with the difference being that it works with the already loaded dataset.\\
  
-**Example**+**Show preview:**  Preview the raw version of the column's data, and the post-split results, using the //Show preview// button at the top of the action settings window.\\
  
-Source dataset:+\\  
 +=====Use cases===== 
 +Use this action when you have a column of text-based data in which the individual values are defined by //positioning// (spaces, tabs, etc.) rather than delimiting characters, and you need to separate them into columns.\\ 
 +\\  
 +If your data has //delimeters//, use the [[transformations:splitdelimitedtext|Split delimited text into columns]] or [[transformations:subfield|Split delimited text into rows]] action, instead.\\ 
 + 
 +\\  
 +=====Action settings===== 
 +^Setting^Description^ 
 +|Column|Select the column containing the text to be split.| 
 +|Decimal separator|Select the character to represent the decimal point for columns determined to be containing numeric values, after splitting.  Options:  //Point// or //Comma//.| 
 +|Thousand separator|Select the character to represent thousands places for columns determined to be containing numeric values, after splitting.  Options:  //Default//, //Comma//, //Point// or //Space//.| 
 +|Treat numeric values|Select how EasyMorph should handle numeric values.  Options: //Always as numbers// or //Always as text//. | 
 +|Keep original column|When selected, the source column will remain in the dataset.| 
 +|New columns|Refer to the table below for //new column// settings.| 
 +|Put remaining symbols into column|Check "on" to capture any characters falling outside the final column's defined width.| 
 +\\  
 +====New columns settings==== 
 +^Setting^Description^ 
 +|Add more columns|This button will open a list where the columns in the imported file can be explicitly defined by Name and Width.\\  NOTE:  Changes made here can be viewed in the preview pane by clicking the //Show preview// button at the top.| 
 +|Name|The names to be assigned to the new columns.| 
 +|Width|The size, in characters, of the column.  Characters that extend past the width of the final column are dropped unless the\\ //Put remaining symbols into column// option is used. See above.| 
 + 
 +{{transformations:split_fw_text_settings.jpg}} 
 + 
 +=====Remarks===== 
 +Leading and trailing whitespace are automatically removed from values when the new columns are created.\\ 
 + 
 + 
 +\\  
 +=====Examples===== 
 +**Example:** Extract the year, month, day, hour, and minutes from the timestamps.\\ 
 +\\  
 +**Source dataset:**
 ^ Timestamp ^ ^ Timestamp ^
 | 20170102T08:31| | 20170102T08:31|
 | 20170103T08:22| | 20170103T08:22|
 | 20170104T08:15| | 20170104T08:15|
 +\\ 
 +**Action settings:**
 +>  Column settings:  Set these in the preview pane or enter them under //New columns//.
 +>  Column 1 Name is "Year" and the Width is 4
 +>  Column 2 Name is "Month" and the Width is 2
 +>  Column 3 Name is "Day", and the Width is 3
 +>  Column 4 Name is "Separator1", and the Width is 1
 +>  Column 5 Name is "Hour", and the Width is 2
 +>  Column 6 Name is "Separator2", and Width is 1
 +>  Put remaining symbols into column "Minutes"
  
-Objective: extract year, month, day, hour and minute from the timestamps. +\\  
- +**Result table:**
-Settings: Year (4 characters), Month (2 characters), Day (3), Separator1 (1), Hours (2), Separator2 (1), Minutes (remaining characters). +
- +
-Result dataset:+
 ^ Year ^ Month ^ Day ^ Separator1 ^ Hour ^ Separator2 ^ Minutes ^ ^ Year ^ Month ^ Day ^ Separator1 ^ Hour ^ Separator2 ^ Minutes ^
 | 2017|01 |02 |T |08 |: |31| | 2017|01 |02 |T |08 |: |31|
 | 2017|01 |03 |T |08 |: |22| | 2017|01 |03 |T |08 |: |22|
 | 2017|01 |04 |T |08 |: |15| | 2017|01 |04 |T |08 |: |15|
 +Use the [[transformations:keepremovecolumns|Keep/Remove columns]] action downstream to remove the "Separator" columns if not needed.
 +
 +\\ 
 +====Community examples====
 +  * [[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: //Headers//; Action position: //4//)
 +  * [[https://community.easymorph.com/t//2454/2|.txt to .csv - Multiple Line & Character Length HELP!]] ([[https://community.easymorph.com/uploads/short-url/6zwA1kxDaRgN7GvTUUmi8r1Qgn4.morph|Project]]; Module: //Main//; Group: //Group 1//; Table: //Type 01//; Action position: //4//)
 +  * [[https://community.easymorph.com/t//2008/2|“Printed” Text File: Could EasyMorph import this?]] ([[https://community.easymorph.com/uploads/short-url/kIb1qqOJb9WK6D1N1jFZdnHzC46.morph|Project]]; Module: //Parse Group//; Group: //Tab 1//; Table: //Header//; Action position: //3//)
  
 +\\ 
 +=====See also=====
  
 +  * [[transformations:importplaintext|Import plain text]]
 +  * [[transformations:splitdelimitedtext|Split delimited text into columns]]
 +  * [[transformations:subfield|Split delimited text into rows]]
transformations/splitfixedwidthtext.1532290572.txt.gz · Last modified: 2018/07/22 16:16 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki