User Tools

Site Tools


transformations:importfixedwidthtext

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
transformations:importfixedwidthtext [2021/03/10 16:52] craigttransformations:importfixedwidthtext [2021/08/14 21:24] (current) – [Advanced options] craigt
Line 1: Line 1:
 {{ transformations:ImportFixedWidthTextAction.png}} {{ transformations:ImportFixedWidthTextAction.png}}
-======IMPORT FIXED WIDTH TEXT FILE====== +======IMPORT FIXED WIDTH TEXT====== 
-Category: Import / File+Category: Import / File\\
  
 +\\ 
 =====Description===== =====Description=====
-This transformation imports text files with columns of fixed width. The width and name of every column have to be defined explicitly in the transformation properties.+This action imports text files with columns of fixed width. The width and name of every column have to be defined explicitly in the transformation properties. 
 + 
 +Use the preview pane (click the //Show preview// button) to visually split the text into columns. Click a character in the preview to create a splitter. Drag a column splitter left or right to adjust the column width.\\ 
 + 
 +**Show preview:**  Preview the raw and imported versions of the dataset using the //Show preview// button at the top of the action settings window.\\ 
 + 
 +\\  
 +=====Use cases===== 
 +Use the //Import fixed width text file// action when you have text-based data in which the fields are defined by //positioning// (spaces, tabs, etc.) rather than delimiting characters and you need to import them into columns.\\ 
 +\\  
 +If your data has //delimiters//, use the [[transformations:importtext|Import delimited text file]] action, instead.  If your data is consolidated in a single field, and spacing between values is inconsistent, use the [[transformations:importplaintext|Import plain text]] action to read it in and use other actions to parse the individual values into columns.\\
  
-Use the preview pane (click the //Show preview// button) to visually split text into columns. Click a character in the preview to create a splitter. Drag a column splitter left or right to adjust the column width.\\ 
 \\  \\ 
-=====Action Settings=====+=====Action settings=====
 ^Setting^Description^ ^Setting^Description^
-|Load file|Fully-qualified file name of the dataset (includes relative or absolute path).|+|Load file<sup>*</sup>|Fully-qualified file name of the dataset (includes relative or absolute path).|
 |Encoding|ASCII, ANSI (with code page), and other types of encoding. If you're not sure what to choose, try UTF-8 as it's the most common Unicode encoding.| |Encoding|ASCII, ANSI (with code page), and other types of encoding. If you're not sure what to choose, try UTF-8 as it's the most common Unicode encoding.|
 |First loaded line contains headers|Check this "on" if the first line of data contains the field names (headers).  If unchecked, columns are given\\ generic "column" names unless user-assigned names are provided in the //New columns// section. see below. | |First loaded line contains headers|Check this "on" if the first line of data contains the field names (headers).  If unchecked, columns are given\\ generic "column" names unless user-assigned names are provided in the //New columns// section. see below. |
 |New columns|Refer to the table below for //new column// settings.| |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.  NOTE: If the\\ //First loaded line contains headers// is checked "on", this column will be named "Remainder" by default.\\  Otherwise, the user can provide the name for this column.| |Put remaining symbols into column|Check "on" to capture any characters falling outside the final column's defined width.  NOTE: If the\\ //First loaded line contains headers// is checked "on", this column will be named "Remainder" by default.\\  Otherwise, the user can provide the name for this column.|
 +<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].
  
-====New columns// settings====+====New columns settings====
 ^Setting^Description^ ^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.| |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.|
Line 23: Line 34:
  
 \\  \\ 
-=====Advanced options=====+====Advanced options====
 ^Setting^Description^ ^Setting^Description^
-|Decimal|Select whether decimal points are represented by a point (.) or comma (,).|+|Decimal separator|Select whether decimal points are represented by a point (.) or comma (,).| 
 +|Thousand separator|Select what character thousands places are represented by.  Options: //Default//, //Comma//, //Point//, or //Space//.|
 |Skip first lines|Defines the number of rows in the incoming dataset to skip before importing data.  Use this in cases where\\ leading rows may contain blank rows or metadata not to be included in the dataset.| |Skip first lines|Defines the number of rows in the incoming dataset to skip before importing data.  Use this in cases where\\ leading rows may contain blank rows or metadata not to be included in the dataset.|
 |Maximum number of lines to load|The maximum number of rows to be imported.  Use "0" to read in all ("unlimited") rows.| |Maximum number of lines to load|The maximum number of rows to be imported.  Use "0" to read in all ("unlimited") rows.|
 +|Treat numeric values|Select how EasyMorph should handle numeric values.  Options: //Always as numbers// or //Always as text//. |
  
 {{transformations:fixed_width_preview_pane.jpg}} {{transformations:fixed_width_preview_pane.jpg}}
  
-=====Importing Multiple Files=====+=====Importing multiple files=====
 This action can import multiple files.  See [[import:fileimportmodes|Importing Multiple Files]] for more information.\\ This action can import multiple files.  See [[import:fileimportmodes|Importing Multiple Files]] for more information.\\
-\\  +
-=====Use cases===== +
-Use the //Import fixed width text file// action when you have text-based data in which the fields are defined by //spacing// (spaces, tabs, leaders, etc.) rather than delimiting characters and you need to import them into columns.\\ +
-\\  +
-If your data has //delimeters//, use the [[transformations:importtext|Import delimited text file]] action, instead.  If your data is consolidated in a single field, and spacing between values is inconsistent, use the [[transformations:importplaintext|Import plain text]] action to read it in and use other actions to parse the individual values into columns.\\+
 \\  \\ 
 =====Examples===== =====Examples=====
Line 45: Line 54:
   *Column widths are known to be 20, 30, 15, 2, 5.   *Column widths are known to be 20, 30, 15, 2, 5.
  
-Input dataset:+**Input dataset:**
 <code> <code>
 Name                Address                       City           STZip Name                Address                       City           STZip
Line 52: Line 61:
 Rick Johanssen      14 Sunset Ave, Apt 16B        Delaware City  DE19706 Rick Johanssen      14 Sunset Ave, Apt 16B        Delaware City  DE19706
 </code> </code>
-Use the following settings to import this dataset:+\\  
 +**Action parameters:**
 >  Column settings:  Set these in the preview pane or enter them under //New columns//. >  Column settings:  Set these in the preview pane or enter them under //New columns//.
 >  Column 1 Name is "Name" and the Width is 20 >  Column 1 Name is "Name" and the Width is 20
Line 62: Line 72:
 For safety, we will add a column to capture overflow characters: For safety, we will add a column to capture overflow characters:
 >  Put remaining symbols into column (checked) This column will be named "Remainder" by default. >  Put remaining symbols into column (checked) This column will be named "Remainder" by default.
-Output dataset:+ 
 +\\  
 +**Result table:**
 ^Name^Address^City^ST^Zip^ ^Name^Address^City^ST^Zip^
-|John Hardy|111 Any Street|Boston|MA|02110| +|John Hardy  |111 Any Street  |Boston|  MA  |02110  
-|Amanda Smythe|16 East Valley Lane|Hanover|MD|21076| +|Amanda Smythe  |16 East Valley Lane  |Hanover  |MD  |21076  
-|Rick Johanssen|14 Sunset Ave, Apt 16B|Delaware City|DE|19706|+|Rick Johanssen  |14 Sunset Ave, Apt 16B  |Delaware City  |DE  |19706  |
  
 \\  \\ 
Line 73: Line 85:
   *There are 5, single-digit responses, all combined   *There are 5, single-digit responses, all combined
   *The first row is a header row of question numbers (1-5)   *The first row is a header row of question numbers (1-5)
-Input dataset:+ 
 +**Input dataset:**
 <code> <code>
 12345 12345
Line 82: Line 95:
 55234 55234
 </code> </code>
 +\\ 
 +**Action parameters:**
 To expand these response values into their appropriate columns, use the following settings: To expand these response values into their appropriate columns, use the following settings:
 >  Column settings:  Set these in the preview pane or enter them under //New columns//. >  Column settings:  Set these in the preview pane or enter them under //New columns//.
Line 90: Line 105:
 >  Column 5 Name is "5", and the Width is 1 >  Column 5 Name is "5", and the Width is 1
  
-Output dataset:+\\  
 +**Result table:**
 ^1^2^3^4^5^ ^1^2^3^4^5^
-|1|4|3|2|4| + 1|  4|  3|  2|  4| 
-|1|1|2|3|2| + 1|  1|  2|  3|  2| 
-|4|5|4|5|5| + 4|  5|  4|  5|  5| 
-|3|4|2|3|4| + 3|  4|  2|  3|  4| 
-|5|5|2|3|4|+ 5|  5|  2|  3|  4|
 In this case, you could also have used the [[transformations:importplaintext|Import plain text]] action to read the entire field into a single cell and parse it into separate columns later in the workflow.\\ In this case, you could also have used the [[transformations:importplaintext|Import plain text]] action to read the entire field into a single cell and parse it into separate columns later in the workflow.\\
 +
 +\\ 
 +=====Shortcuts=====
 +Fast ways to create the action:
 +  * Press the "Add data" menu button. Pick "Import file" or "Import multiple files".
  
 \\  \\ 
transformations/importfixedwidthtext.txt · Last modified: 2021/08/14 21:24 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki