User Tools

Site Tools


transformations:importtext

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:importtext [2018/08/15 08:18] dmitrytransformations:importtext [2023/10/11 20:48] (current) – [Remarks] craigt
Line 1: Line 1:
-===== Import from delimited text file =====+{{ transformations:ImportDelimitedTextAction.png}} 
 +======IMPORT DELIMITED TEXT FILE====== 
 +Category: Import / File\\
  
 +\\ 
 +=====Description=====
 This action loads data from one or multiple delimited text files. This action loads data from one or multiple delimited text files.
  
-The number of columns in the resulting dataset is defined by the 1st row of imported data.+The number of columns in the resulting dataset is defined by the first row of imported data.\\
  
-**Options**+\\  
 +=====Use cases===== 
 +Use the //Import from a delimited text file// action when you have a plain text, structured, data file with fields that are separated by a delimiting character.  In the case of a file having //no// embedded delimiters, all values are imported into a single field.\\
  
-//Encoding// - ASCII, ANSI (with code page), and other types of encoding. If you're not sure what to chose, try UTF-8 as it's the most common Unicode encoding.+\\  
 +=====Action settings===== 
 +^ Setting  ^ Description 
 +|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.
 +|Separator|The delimiter character that separates one value from another. For instance, for CSV files it should be a comma.\\ A custom separator consisting of up to 8 characters can also be specified.  If //No separator// is selected, all values are imported into a single field.| 
 +|Decimal|When a text value looks like a number, EasyMorph converts it into a number. The decimal character specifies whether such numbers should have a comma or a dot as the decimal separator.| 
 +|Thousand|When a text value looks like a number, EasyMorph converts it into a number. Select the separator used to define the thousands places within the value.  Options:  //Default//, //Comma//, //Point// or //Space//.| 
 +|Skip first lines<sup>*</sup>|This option specifies how many lines to skip from the beginning of a file. It can be helpful in cases where first rows\\ contain some metadata (file header) and actual tabular data starts only after that metadata. This setting can be specified using a parameter as well.| 
 +|Columns don't have headers|Check this if data doesn't have column headers.|
  
-//Separator// - the delimiter character that separates one value from another. For instance, for CSV files it should be comma. A custom separator consisting of up to 8 characters can also be specified.+<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].
  
-//Decimal// - when text value looks like a numberEasyMorph converts it into a numberThe decimal character specifies whether such numbers should have comma or dot as decimal separator.+\\  
 +====Advanced options==== 
 +^ Setting  ^ Description 
 +|Show parsing errors|Check this to add column that contains parsing errors (if any) for each line. It can help detect rows that have too few valuesor too many values.
 +|Ignore quoting|By default, values wrapped in double quotes can contain the separator character and line breaks. Check this option if wrapping double quotes should be treated as regular characters.| 
 +|Maximum number of lines to load<sup>*</sup>|Limits the number of rows loaded from the file. This setting is applied after //Skip first lines//. Use "0" to load all rows.| 
 +<sup>*</sup> Setting can be specified using a [[:parameters|parameter]].\\
  
-//Skip first lines// - this option specifies how many lines to skip from the beginning of a file. It can be helpful in case when first rows contain some metadata (file header) and actual tabular data starts only after that metadata. This setting can be specified using a parameter as well.+\\  
 +=====Remarks===== 
 +Preview the raw and imported versions of the dataset using the //Show preview// button at the top of the action settings window.\\
  
-//Columns don't have headers// - check this if data doesn't have column headers.+This action can import multiple files See [[import:fileimportmodes|Importing Multiple Files]] for more information.\\
  
-**Advanced options**+**Import 2 to 3 times faster (experimental feature).**  To enable this feature, check //on// the "Twice faster CSV import" option in Application Settings (in the About toolbar).
  
-//Show parsing errors// - check this to add a column that contains parsing errors (if any) for each lineIt can help detect rows that have too few values, or too many values.+\\  
 +=====Examples===== 
 +**Input:** 
 +<code> 
 +... 
 +Data to import 
 +--- 
 +1|12|3.5|red|265 
 +2|47|4.55|teal|354 
 +3|4|8.1|burgundy|380 
 +</code>
  
-//Ignore quoting// - by default, values wrapped in double quotes can contain the separator character and line breaks. Check this option if wrapping double quotes should be treated as regular characters.+The input text has the following properties: 
 +  * pipe-delimited .txt  
 +  * starts with 3 rows of metadata 
 +  * has no header rows 
 +\\  
 +**Action parameters:** 
 +>  Separator is Pipe 
 +>  Skip the 3 first lines 
 +>  Columns don't have headers (checked)
  
-//Maximum number of lines to load// - limits the number of rows loaded from the fileThis setting is applied after //Skip first lines//Use 0 to load all rows.+\\  
 +**Result table:** 
 +|  1|  12|  3.5|red|  265| 
 +|  2|  47|  4.55|teal|  354| 
 +|  3|  4|  8.1|burgundy|  380|
  
 +\\ 
 +====Community examples====
 +  * [[https://community.easymorph.com/t//1538/2|Suffix with comma between last name and suffix causing rows to shift]] ([[https://community.easymorph.com/uploads/short-url/5wpGSARRp4GlknxWvCz6DpmyBNV.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //data.csv//;\\ Action position: //1//)
 +  * [[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: //Read, Mark groups//; Action position: //1//)
 +  * [[https://community.easymorph.com/t//2454/4|.txt to .csv - Multiple Line & Character Length HELP!
 +]] ([[https://community.easymorph.com/uploads/short-url/m3PqCDwhBrNEG2xW23QqEvl8RbX.morph|Project]]; Module: //Main//; Group: //Group 1//; Table: //SAMPLE.txt//; Action position: //1//)
 +  * [[https://community.easymorph.com/t//1800/4|Download multiple files from HTTPS and copy to folder, preserving file names]] ([[https://community.easymorph.com/uploads/short-url/pQyGPi01bpxaWBHR6LdGlGMyRbH.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 1//; Action position: //2//)
 +
 +\\ 
 +=====Shortcuts=====
 +Fast ways to create the action:
 +  * Press the "Add data" menu button. Pick "Import file" or "Import multiple files".
 +  * Drag a text file into the application window. Supported file extensions: csv, psv, tsv.
 +  * Drag a folder with text files into the application window.
 +
 +\\ 
 +=====See also=====
 +  * [[transformations:importfixedwidthtext|Import fixed width text file]]
 +  * [[transformations:importplaintext|Import plain text]]
 +  * [[transformations:filesplitter|Split delimited text file]]
 +  * [[transformations:splitdelimitedtext|Split delimited text into columns]]
 +  * [[transformations:subfield|Split delimited text into rows]]
  
transformations/importtext.1534335516.txt.gz · Last modified: 2018/08/15 08:18 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki