User Tools

Site Tools


transformations:splitfixedwidthtext

SPLIT FIXED WIDTH TEXT

Category: Transform / Advanced


Description

This action splits text values of the selected column into multiple columns of values of specified lengths. It is similar to the Import fixed width text action with the difference being that it works with the already loaded 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 Split delimited text into columns or Split delimited text into rows action, instead.


Action settings

SettingDescription
ColumnSelect the column containing the text to be split.
Decimal separatorSelect the character to represent the decimal point for columns determined to be containing numeric values, after splitting. Options: Point or Comma.
Thousand separatorSelect the character to represent thousands places for columns determined to be containing numeric values, after splitting. Options: Default, Comma, Point or Space.
Treat numeric valuesSelect how EasyMorph should handle numeric values. Options: Always as numbers or Always as text.
Keep original columnWhen selected, the source column will remain in the dataset.
New columnsRefer to the table below for new column settings.
Put remaining symbols into columnCheck "on" to capture any characters falling outside the final column's defined width.


New columns settings

SettingDescription
Add more columnsThis 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.
NameThe names to be assigned to the new columns.
WidthThe 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.

split_fw_text_settings.jpg

Remarks

Leading and trailing whitespace are automatically removed from values when the new columns are created.

When splitting numeric values (see Example #1, below), values with leading 0's are output as text.

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.


Examples

Example #1

Extract the year, month, day, hour, and minutes from the timestamps.

Before (source table)

Timestamp
201701020831
201701030822
201701040815

After (result table)

Year Month Day Hour Mins
201701 02 08 31
201701 03 08 22
201701 04 08 15

Action settings

Column settings: Set these in the preview pane or enter them under New columns.
Column 1 Name: Year (width=4)
Column 2 Name: Month (width=2
Column 3 Name: Day(width=2)
Column 5 Name: Hour (width= 2)
Put remaining symbols into column (Mins)


Community examples


See also

transformations/splitfixedwidthtext.txt · Last modified: 2025/01/19 15:37 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki