ComposantsComponents › Fichier › LectureFile › Input
Lit un fichier texte ligne par ligne et découpe chaque ligne en champs à chaque séparateur (; par défaut) : un champ par colonne du schéma, converti dans le type de la colonne. Avec les options CSV, un champ entre guillemets peut contenir le séparateur, des guillemets ou un saut de ligne. C'est le composant à placer au début d'un sous-job pour lire un fichier CSV ou délimité, produit par un autre outil ou par un tFileOutputDelimited.
Reads a text file line by line and splits each line into fields at each separator (; by default): one field per schema column, converted to the type of the column. With the CSV options, a field in quotes can hold the separator, quotes or a line break. It is the component to put at the start of a subjob to read a CSV or delimited file, produced by another tool or by a tFileOutputDelimited.
EntréeInput
Aucune : il commence son sous-job. Sinon un lien Iterate : il lit le fichier à chaque itération. None: it starts its subjob. Otherwise one Iterate link: it reads the file at each iteration.
SortieOutput
Main un flux : les lignes luesone flow: the rows read
Reject facultatif : les lignes en erreur, avec errorMessage ; absent si Arrêter en cas d'erreur est cochéoptional: the rows in error, with errorMessage; absent if Die on error is checked
Déclencheurs en sortieOutput triggers
On Subjob Ok On Subjob Error On Component Ok On Component Error Run if
On Subjob : seulement quand il commence son sous-job. On Subjob: only when it starts its subjob.
Le cas courant : lire un fichier, puis le transformer ou le charger. Le schéma décrit les champs du fichier, dans leur ordre, avec leur type. The common case: read a file, then transform or load it. The schema describes the fields of the file, in their order, with their type.
Les lignes qui ne se convertissent pas, ou dont le nombre de champs est faux si la vérification est cochée, partent par le lien Reject avec leur message d'erreur (voir l'exemple). The rows that do not convert, or whose number of fields is wrong if the check is on, leave through the Reject link with their error message (see the example).
1 si la première ligne donne le nom des colonnes.
Set the File name, the Field Separator and the Header: 1 if the first line gives the column names.
"dd-MM-yyyy").
Describe the Schema columns in the order of the fields of the file, with their type and, for dates, their pattern ("dd-MM-yyyy").
ISO-8859-15 par défaut, souvent "UTF-8" pour un fichier récent), puis reliez la sortie Main au composant suivant.
In the Advanced settings, choose the Encoding (ISO-8859-15 by default, often "UTF-8" for a recent file), then connect the Main output to the next component.
Les libellés sont ceux de l'onglet Composant ; le nom technique, en gris, est celui du paramètre dans le fichier du job. Le nom de fichier et les séparateurs sont des expressions Java : gardez les guillemets (";", "\t" pour une tabulation) ; une variable de contexte est acceptée. L'onglet affiche aussi le rappel When the input source is a stream or a zip file, footer and random shouldn't be bigger than 0.
Labels are those of the Component tab; the technical name, in grey, is the parameter name in the job file. The file name and the separators are Java expressions: keep the quotes (";", "\t" for a tab); a context variable is accepted. The tab also shows the reminder When the input source is a stream or a zip file, footer and random shouldn't be bigger than 0.
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| Type de propriétéProperty TypePROPERTY | Built-inBuilt-In | ToujoursAlways | Built-in : les réglages sont saisis dans le composant. Référentiel : le nom du fichier, les séparateurs, les options CSV, l'en-tête, le pied, la limite, les lignes vides, l'encodage et le découpage des lignes viennent d'une métadonnée de fichier délimité du Référentiel, comme le schéma. Built-In: the settings are typed in the component. Repository: the file name, the separators, the CSV options, the header, the footer, the limit, the empty rows, the encoding and the row splitting come from a delimited file metadata of the Repository, like the schema. |
| SchémaSchemaSCHEMA | — | ToujoursAlways | Les colonnes lues, dans l'ordre des champs : le premier champ va dans la première colonne, et ainsi de suite. Leur nom n'a pas à être celui de l'en-tête. Voir la lecture des valeurs. The columns read, in the order of the fields: the first field goes to the first column, and so on. Their name does not have to be the one of the header. See how values are read. |
| Utiliser dynamique existantUse existing dynamicUSE_EXISTING_DYNAMIC | NonNo | ToujoursAlways |
Pour une colonne Dynamic : reprendre les colonnes décrites par un composant tSetDynamicSchema du job au lieu de les lire dans l'en-tête. Ce composant n'existe pas dans Talaxie : la liste suivante reste vide.
For a Dynamic column: take the columns described by a tSetDynamicSchema component of the job instead of reading them in the header. This component does not exist in Talaxie: the next list stays empty.
|
| Liste des composantsComponent ListDYNAMIC | — | Dynamique existant cochéExisting dynamic checked |
Le tSetDynamicSchema à reprendre.
The tSetDynamicSchema to take.
|
| Nom de fichier/FluxFile name/StreamFILENAME | chemin par défaut + /in.csvdefault path + /in.csv |
ToujoursAlways |
Le fichier lu : context.folder + "/people.csv". Peut aussi être un flux Java, avec sa conversion : (java.io.InputStream) globalMap.get("in") ; le composant ne le ferme pas, et le pied de page et l'extraction au hasard doivent rester à 0 (voir l'exemple). Un fichier absent : voir les erreurs.
The file read: context.folder + "/people.csv". Can also be a Java stream, with its cast: (java.io.InputStream) globalMap.get("in"); the component does not close it, and the footer and the random extraction must stay at 0 (see the example). A missing file: see the errors.
|
| Séparateur de lignesRow SeparatorROWSEPARATOR | "\n" |
Options CSV décochéesCSV options unchecked |
La fin d'une ligne. Avec "\n" (défaut), LF, CRLF et CR seul terminent tous une ligne : un fichier Windows se lit sans réglage. Toute autre valeur est cherchée telle quelle, sur un ou plusieurs caractères ("\r\n", ";\n").
The end of a line. With "\n" (default), LF, CRLF and a lone CR all end a line: a Windows file is read without setting anything. Any other value is searched as is, on one or more characters ("\r\n", ";\n").
|
| Séparateur de lignes CSVCSV Row SeparatorCSVROWSEPARATOR | LF("\n") |
Options CSV cochéesCSV options checked |
LF("\n"), CR("\r"), CRLF("\r\n"), ou une valeur saisie dont seul le premier caractère compte. Quand ce caractère est LF ou CR, le lecteur CSV reconnaît lui-même LF et CRLF (essayé : un fichier CRLF lu avec LF ne garde aucun \r) ; sinon c'est ce caractère qui termine la ligne.
LF("\n"), CR("\r"), CRLF("\r\n"), or a typed value whose first character only counts. When that character is LF or CR, the CSV reader recognises LF and CRLF itself (tried: a CRLF file read with LF keeps no \r); otherwise that character ends the line.
|
| Séparateur de champsField SeparatorFIELDSEPARATOR | ";" |
ToujoursAlways |
Le texte entre deux champs : ";", ",", "\t". Sans options CSV, plusieurs caractères sont cherchés tels quels ("||") ; avec, seul le premier compte (voir l'exemple), et une valeur vide arrête le composant.
The text between two fields: ";", ",", "\t". Without CSV options, several characters are searched as is ("||"); with them, only the first one counts (see the example), and an empty value stops the component.
|
| Options CSVCSV optionsCSV_OPTION | NonNo | ToujoursAlways |
Lit le fichier avec le lecteur CSV : un champ entre guillemets peut contenir le séparateur, un saut de ligne et des guillemets doublés. Remplace le Séparateur de lignes par le Séparateur de lignes CSV, masque l'extraction au hasard et le découpage des lignes. Un champ manquant ou une ligne vide gardée donnent alors null au lieu d'une chaîne vide (voir la lecture des valeurs). Voir l'exemple.
Reads the file with the CSV reader: a field in quotes can hold the separator, a line break and doubled quotes. Replaces the Row Separator with the CSV Row Separator, hides the random extraction and the row splitting. A missing field or a kept empty line then give null instead of an empty string (see how values are read). See the example.
|
| Caractère d'échappementEscape charESCAPE_CHAR | """ |
Options CSV cochéesCSV options checked |
Seules deux façons existent : avec "\\", un guillemet dans un champ s'écrit \" ; toute autre valeur revient au guillemet doublé (""), le défaut. Voir l'exemple.
Only two ways exist: with "\\", a quote inside a field is written \"; any other value comes back to the doubled quote (""), the default. See the example.
|
| Entourage du texteText enclosureTEXT_ENCLOSURE | """ |
Options CSV cochéesCSV options checked |
Le caractère qui peut entourer un champ, le guillemet par défaut (le Studio l'écrit """) ; un champ peut aussi ne pas en avoir. D'après le modèle : "" saisi tel quel n'entoure rien ; une variable vide arrête le composant.
The character that can enclose a field, the double quote by default (the Studio writes it """); a field may also have none. From the template: "" typed as is encloses nothing; an empty variable stops the component.
|
| En-têteHeaderHEADER | 0 |
ToujoursAlways |
Nombre de lignes passées au début du fichier, sans conversion : 1 pour une ligne de noms de colonnes. Laissé à 0 sur un fichier qui a un en-tête, cette ligne est lue comme les autres et échoue sur les colonnes numériques (voir l'exemple). Dans une archive zip, l'en-tête est passé dans chaque fichier.
Number of lines skipped at the start of the file, without conversion: 1 for a line of column names. Left at 0 on a file that has a header, that line is read like the others and fails on the number columns (see the example). In a zip archive, the header is skipped in each file.
|
| Pied de pageFooterFOOTER | 0 |
Décompresser décochéUncompress unchecked | Nombre de lignes ignorées à la fin du fichier (un total, une ligne de fin). Le fichier est alors lu deux fois, une première fois pour compter ses lignes ; impossible avec un flux. Number of lines ignored at the end of the file (a total, an end line). The file is then read twice, a first time to count its lines; impossible with a stream. |
| LimiteLimitLIMIT | vide (aucune)empty (none) | ToujoursAlways |
Nombre maximal de lignes envoyées, après l'en-tête. 0 n'en envoie aucune.
Maximum number of rows sent, after the header. 0 sends none.
|
| Ignorer les lignes videsSkip empty rowsREMOVE_EMPTY_ROW | OuiYes | ToujoursAlways | Saute les lignes vides. Décochée, chaque ligne vide donne une ligne de valeurs vides ou nulles (voir l'exemple). Une ligne faite d'espaces n'est pas vide. Skips the empty lines. Unchecked, each empty line gives a row of empty or null values (see the example). A line made of spaces is not empty. |
| Décompresser en tant que fichier ZIPUncompress as zip fileUNCOMPRESS | NonNo | ToujoursAlways | Lit une archive zip : chaque fichier qu'elle contient, l'un après l'autre, avec les mêmes réglages. Masque le pied de page et l'extraction au hasard, qui ne s'appliquent pas. Voir l'exemple. Reads a zip archive: each file it holds, one after the other, with the same settings. Hides the footer and the random extraction, which do not apply. See the example. |
| Arrêter en cas d'erreurDie on errorDIE_ON_ERROR | NonNo | ToujoursAlways | Décochée, une ligne en erreur part par le lien Reject s'il y en a un ; sinon son message est écrit sur la sortie d'erreur et elle est écartée. Un fichier absent est seulement signalé. Cochée, la première erreur arrête le job, et le lien Reject n'est plus proposé. Voir les erreurs. Unchecked, a row in error leaves through the Reject link if there is one; otherwise its message is written to the error output and it is set aside. A missing file is only reported. Checked, the first error stops the job, and the Reject link is no longer offered. See the errors. |
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| Séparateur avancé (pour les nombres)Advanced separator (for numbers)ADVANCED_SEPARATOR | NonNo | ToujoursAlways |
Lit les nombres écrits avec les deux séparateurs ci-dessous : avec "." et ",", 1.250,50 donne 1250.50. Vaut pour toutes les colonnes numériques. Voir l'exemple.
Reads numbers written with the two separators below: with "." and ",", 1.250,50 gives 1250.50. Applies to all the number columns. See the example.
|
| Séparateur de milliersThousands separatorTHOUSANDS_SEPARATOR | "," |
Séparateur avancé cochéAdvanced separator checked | Retiré du texte avant la conversion, où qu'il soit. Removed from the text before the conversion, wherever it is. |
| Séparateur décimalDecimal separatorDECIMAL_SEPARATOR | "." |
Séparateur avancé cochéAdvanced separator checked | Remplacé par un point avant la conversion. Replaced with a point before the conversion. |
| Extraire des lignes au hasardExtract lines at randomRANDOM | NonNo | Options CSV et Décompresser décochésCSV options and Uncompress unchecked | Envoie un nombre de lignes tirées au hasard, dans l'ordre du fichier ; le tirage change à chaque exécution. Le fichier est lu deux fois ; impossible avec un flux. Sends a number of lines drawn at random, in the order of the file; the draw changes at each run. The file is read twice; impossible with a stream. |
| Nombre de lignesNumber of linesNB_RANDOM | 10 |
Au hasard cochéAt random checked | Nombre de lignes tirées ; tout le fichier s'il en a moins. Avec une Limite, au plus la limite. Number of lines drawn; the whole file if it has fewer. With a Limit, at most the limit. |
| EncodageEncodingENCODING | "ISO-8859-15" |
ToujoursAlways |
L'encodage du fichier. Le défaut n'est pas UTF-8 : un fichier UTF-8 lu tel quel donne Café au lieu de Café. Une marque d'ordre des octets (BOM) UTF-8 au début du fichier l'emporte sur ce réglage, avec ou sans options CSV, et n'apparaît pas dans le premier champ (voir l'exemple).
The encoding of the file. The default is not UTF-8: a UTF-8 file read as is gives Café instead of Café. A UTF-8 byte order mark (BOM) at the start of the file wins over this setting, with or without CSV options, and does not show in the first field (see the example).
|
| Supprimer les espaces en début et fin de champ dans toutes les colonnesTrim all columnsTRIMALL | NonNo | ToujoursAlways |
Retire les espaces (et tabulations) au début et à la fin de chaque champ, avant la conversion. Sans elle, 1 ne se convertit pas en Integer (voir l'exemple).
Removes the spaces (and tabs) at the start and at the end of each field, before the conversion. Without it, 1 does not convert to Integer (see the example).
|
| Vérifier la structure de chaque ligne par rapport au schémaCheck each row structure against schemaCHECK_FIELDS_NUM | NonNo | ToujoursAlways |
Met en erreur une ligne qui n'a pas autant de champs que le schéma de colonnes : Column(s) missing ou Too many columns. Sans elle, les champs manquants sont vides et ceux en trop ignorés (voir l'exemple). Rend aussi la lecture des dates stricte, comme Vérifier la date (essayé).
Puts in error a row that does not have as many fields as the schema has columns: Column(s) missing or Too many columns. Without it, missing fields are empty and extra ones ignored (see the example). Also makes date reading strict, like Check date (tried).
|
| Vérifier la dateCheck dateCHECK_DATE | NonNo | ToujoursAlways |
Lecture stricte des dates : 31-02-2021 ou une date d'un autre format sont des erreurs. Sans elle, la date est lue avec tolérance : 31-02-2021 devient le 3 mars (voir l'exemple).
Strict date reading: 31-02-2021 or a date in another format are errors. Without it, the date is read leniently: 31-02-2021 becomes March 3 (see the example).
|
| Sélectionner la colonne où supprimer les espaces entourant les champsCheck column to trimTRIMSELECT | — | Toutes les colonnes décochéTrim all unchecked | Une ligne par colonne du schéma : cochez Supprimer les espaces en début et fin de champ pour les colonnes à nettoyer. One line per schema column: check Trim for the columns to clean. |
| Scinder la ligne avant le champSplit row before fieldSPLITRECORD | NonNo | Options CSV décochéesCSV options unchecked |
Cherche la fin de ligne avant le séparateur de champs. À cocher quand le séparateur de lignes commence par le séparateur de champs (lignes terminées par ;, séparateur de lignes ";\n") : sans elle, la fin de ligne n'est jamais trouvée (voir l'exemple).
Looks for the line end before the field separator. To check when the row separator starts with the field separator (lines ended with ;, row separator ";\n"): without it, the line end is never found (see the example).
|
| Autoriser l'hexadécimal (0xNNN) ou l'octal (0NNNN) pour les types numériquesPermit hexadecimal (0xNNN) or octal (0NNNN) for numeric typesENABLE_DECODE | NonNo | ToujoursAlways |
Pour les colonnes entières cochées dans le tableau suivant (Byte, Short, Integer, Long) : 0x1F se lit 31, et un nombre qui commence par 0 se lit en octal, 017 donne 15 (voir l'exemple). Le libellé complet du Studio est plus long.
For the integer columns checked in the next table (Byte, Short, Integer, Long): 0x1F reads as 31, and a number starting with 0 reads as octal, 017 gives 15 (see the example). The full Studio label is longer.
|
| Décoder la tableDecode tableDECODE_COLS | — | Hexadécimal cochéHexadecimal checked | Une ligne par colonne du schéma : cochez Autoriser l'hexadécimal ou l'octal pour les colonnes à décoder. One line per schema column: check Permit hexadecimal or octal for the columns to decode. |
| Utiliser l'en-tête tel quelUse Header As IsUSE_HEADER_AS_IS | NonNo | Dynamique existant décochéExisting dynamic unchecked |
Pour une colonne Dynamic : garde les noms de l'en-tête tels quels. Sans elle, les espaces, points et tirets y deviennent _ : first name donne first_name (voir l'exemple).
For a Dynamic column: keeps the header names as is. Without it, spaces, points and dashes become _: first name gives first_name (see the example).
|
null.
String: the text of the field, as is. An empty field gives an empty string, not null.
null ; pour une colonne non nullable (type primitif), la ligne est en erreur : Value is empty for column (voir l'exemple).
Other types, empty field: null; for a non-nullable column (primitive type), the row is in error: Value is empty for column (see the example).
null avec, même pour une String.
Missing field (line too short): like an empty field without CSV options; null with them, even for a String.
1250.50, -3), sans espace ni séparateur de milliers, sauf avec le séparateur avancé. Un BigDecimal garde les décimales écrites (80.00).
Numbers: Java notation (1250.50, -3), without space or thousands separator, except with the advanced separator. A BigDecimal keeps the written decimals (80.00).
null si le fichier n'a pas pu être ouvert.Number of rows read, header and footer not counted; the rows in error, rejected or set aside, are counted. Available after the component has run; null if the file could not be opened.((Integer) globalMap.get("tFileInputDelimited_1_NB_LINE"))
((String) globalMap.get("tFileInputDelimited_1_ERROR_MESSAGE"))
Les fichiers sont dans le dossier de la variable de contexte folder, raccourcie ici en C:/data ; le nom de fichier est par exemple context.folder + "/people.csv". Leur contenu est montré avec les fins de ligne visibles. Un tLogRow en mode Table affiche les lignes lues, puis un tJava relié par On Subjob Ok affiche NB_LINE. Les sorties sont celles de la console, copiées depuis une exécution du job ; les messages de la sortie d'erreur y sont mêlés.
The files are in the folder of the folder context variable, shortened here to C:/data; the file name is for instance context.folder + "/people.csv". Their content is shown with the line ends made visible. A tLogRow in Table mode prints the rows read, then a tJava connected with On Subjob Ok prints NB_LINE. The outputs are the console ones, copied from a run of the job; the messages of the error output are mixed in.
System.out.println("NB_LINE: " + globalMap.get("tFileInputDelimited_1_NB_LINE"));
Schéma des premiers exemples, puis le fichier people.csv :
Schema of the first examples, then the people.csv file:
| idInteger | nameString | cityString | amountBigDecimal | sinceDate, "dd-MM-yyyy" |
|---|
id;name;city;amount;since\n
1;Ada;London;1250.50;15-03-2021\n
2;Grace;;80.00;02-11-2023\n
3;Alan;Manchester;3.14;\n
Seul le nom de fichier est réglé ; l'En-tête reste à 0. Only the file name is set; the Header stays at 0.
Couldn't parse value for column 'id' in 'row1', value is 'id'. Details: java.lang.NumberFormatException: For input string: "id" .--+-----+----------+-------+----------. | tLogRow_1 | |=-+-----+----------+-------+---------=| |id|name |city |amount |since | |=-+-----+----------+-------+---------=| |1 |Ada |London |1250.50|15-03-2021| |2 |Grace| |80.00 |02-11-2023| |3 |Alan |Manchester|3.14 |null | '--+-----+----------+-------+----------' NB_LINE: 4
La ligne d'en-tête est lue comme une donnée : id n'est pas un nombre, son message part sur la sortie d'erreur et la ligne est écartée, mais elle est comptée.
The header line is read as data: id is not a number, its message goes to the error output and the row is set aside, but it is counted.
En-tête 1 :
Header 1:
.--+-----+----------+-------+----------. | tLogRow_1 | |=-+-----+----------+-------+---------=| |id|name |city |amount |since | |=-+-----+----------+-------+---------=| |1 |Ada |London |1250.50|15-03-2021| |2 |Grace| |80.00 |02-11-2023| |3 |Alan |Manchester|3.14 |null | '--+-----+----------+-------+----------' NB_LINE: 3
La ville vide de Grace est une chaîne vide (String) ; la date vide d'Alan est null. Le montant garde ses décimales.
Grace's empty city is an empty string (String); Alan's empty date is null. The amount keeps its decimals.
header_footer.csv a une ligne de titre, l'en-tête, quatre lignes et un total :
header_footer.csv has a title line, the header, four lines and a total:
Customers export\n
id;name;city;amount;since\n
1;Ada;London;1250.50;15-03-2021\n
2;Grace;;80.00;02-11-2023\n
3;Alan;Manchester;3.14;\n
4;Edsger;Rotterdam;12.00;01-01-2020\n
Total: 4 rows\n
En-tête 2, Pied de page 1 : Header 2, Footer 1:
.--+------+----------+-------+----------. | tLogRow_1 | |=-+------+----------+-------+---------=| |id|name |city |amount |since | |=-+------+----------+-------+---------=| |1 |Ada |London |1250.50|15-03-2021| |2 |Grace | |80.00 |02-11-2023| |3 |Alan |Manchester|3.14 |null | |4 |Edsger|Rotterdam |12.00 |01-01-2020| '--+------+----------+-------+----------' NB_LINE: 4
Avec en plus une Limite de 2, avec ou sans options CSV (essayé les deux) : With a Limit of 2 as well, with or without CSV options (both tried):
.--+-----+------+-------+----------. | tLogRow_1 | |=-+-----+------+-------+---------=| |id|name |city |amount |since | |=-+-----+------+-------+---------=| |1 |Ada |London|1250.50|15-03-2021| |2 |Grace| |80.00 |02-11-2023| '--+-----+------+-------+----------' NB_LINE: 2
empty_lines.csv, sans en-tête, a deux lignes vides. Par défaut, elles sont sautées (3 lignes, NB_LINE 3). Ignorer les lignes vides décoché :
empty_lines.csv, without header, has two empty lines. By default, they are skipped (3 rows, NB_LINE 3). Skip empty rows unchecked:
1;Ada;London;1250.50;15-03-2021\n
\n
2;Grace;;80.00;02-11-2023\n
\n
3;Alan;Manchester;3.14;\n
.--+-----+----------+-------+----------. | tLogRow_1 | |=-+-----+----------+-------+---------=| |id|name |city |amount |since | |=-+-----+----------+-------+---------=| |1 |Ada |London |1250.50|15-03-2021| |null| | |null |null | |2 |Grace| |80.00 |02-11-2023| |null| | |null |null | |3 |Alan |Manchester|3.14 |null | '--+-----+----------+-------+----------' NB_LINE: 5
Chaque ligne vide donne des chaînes vides et des null. Avec les options CSV en plus, les String aussi sont null :
Each empty line gives empty strings and null values. With the CSV options as well, the Strings are null too:
.--+-----+----------+-------+----------. | tLogRow_1 | |=-+-----+----------+-------+---------=| |id|name |city |amount |since | |=-+-----+----------+-------+---------=| |1 |Ada |London |1250.50|15-03-2021| |null|null |null |null |null | |2 |Grace| |80.00 |02-11-2023| |null|null |null |null |null | |3 |Alan |Manchester|3.14 |null | '--+-----+----------+-------+----------' NB_LINE: 5
people.zip contient deux fichiers, chacun avec son en-tête :
people.zip holds two files, each one with its header:
part1.csv id;name;city;amount;since\n
1;Ada;London;1250.50;15-03-2021\n
2;Grace;;80.00;02-11-2023\n
part2.csv id;name;city;amount;since\n
3;Alan;Manchester;3.14;\n
Décompresser en tant que fichier ZIP coché, En-tête 1, avec ou sans options CSV (même sortie) : Uncompress as zip file checked, Header 1, with or without CSV options (same output):
.--+-----+----------+-------+----------. | tLogRow_1 | |=-+-----+----------+-------+---------=| |id|name |city |amount |since | |=-+-----+----------+-------+---------=| |1 |Ada |London |1250.50|15-03-2021| |2 |Grace| |80.00 |02-11-2023| |3 |Alan |Manchester|3.14 |null | '--+-----+----------+-------+----------' NB_LINE: 3
L'en-tête est passé dans chaque fichier ; NB_LINE est le total. The header is skipped in each file; NB_LINE is the total.
people.csv, En-tête 1, Extraire des lignes au hasard coché, Nombre de lignes 2. Une exécution :
people.csv, Header 1, Extract lines at random checked, Number of lines 2. One run:
.--+-----+------+-------+----------. | tLogRow_1 | |=-+-----+------+-------+---------=| |id|name |city |amount |since | |=-+-----+------+-------+---------=| |1 |Ada |London|1250.50|15-03-2021| |2 |Grace| |80.00 |02-11-2023| '--+-----+------+-------+----------' NB_LINE: 2
Les lignes tirées gardent l'ordre du fichier ; une autre exécution peut en tirer d'autres. The lines drawn keep the order of the file; another run may draw others.
notes.csv, écrit sous Windows (fins de ligne CRLF) : une note qui contient le séparateur, un nom avec des guillemets doublés, une note sur deux lignes, une note vide. Schéma id (Integer), name, note (String), En-tête 1. Ici, un tJavaRow affiche chaque valeur entre crochets, \r et \n visibles :
notes.csv, written on Windows (CRLF line ends): a note that holds the separator, a name with doubled quotes, a note on two lines, an empty note. Schema id (Integer), name, note (String), Header 1. Here, a tJavaRow prints each value in brackets, \r and \n made visible:
System.out.println("[" + String.valueOf(input_row.id).replace("\r", "\\r").replace("\n", "\\n") + "]"
+ " " + "[" + String.valueOf(input_row.name).replace("\r", "\\r").replace("\n", "\\n") + "]"
+ " " + "[" + String.valueOf(input_row.note).replace("\r", "\\r").replace("\n", "\\n") + "]");
id;name;note\r\n
1;Ada;"London; UK"\r\n
2;"Grace ""Amazing""";"first line\n
second line"\r\n
3;Alan;\r\n
[1] [Ada] ["London] [2] ["Grace ""Amazing"""] ["first line] Couldn't parse value for column 'id' in 'row1', value is 'second line"'. Details: java.lang.NumberFormatException: For input string: "second line"" [3] [Alan] [] NB_LINE: 4
Les guillemets sont du texte : le ; de la note coupe le champ ( UK" est un champ de trop, ignoré), et la note sur deux lignes devient deux lignes, dont la seconde échoue. Aucun \r ne reste : "\n" reconnaît aussi CRLF.
The quotes are text: the ; of the note cuts the field ( UK" is an extra field, ignored), and the note on two lines becomes two rows, the second of which fails. No \r is left: "\n" also recognises CRLF.
[1] [Ada] [London; UK] [2] [Grace "Amazing"] [first line\nsecond line] [3] [Alan] [] NB_LINE: 3
Les guillemets qui entourent sont retirés, les guillemets doublés redeviennent simples, le saut de ligne reste dans la note. Le Séparateur de lignes CSV LF lit les CRLF sans laisser de \r.
The enclosing quotes are removed, the doubled quotes become single again, the line break stays in the note. The LF CSV Row Separator reads the CRLF without leaving any \r.
backslash.csv, sans en-tête : la ligne 1 échappe par barre oblique inverse, la ligne 2 par guillemets doublés. Lu avec Caractère d'échappement "\\", puis avec le défaut :
backslash.csv, without header: line 1 escapes with a backslash, line 2 with doubled quotes. Read with Escape char "\\", then with the default:
1;"Grace \"Amazing\"";"C:\\data"\n
2;"Alan";"a ""b"""\n
[1] [Grace "Amazing"] [C:\data] [2] [Alan] [a ]
[1] [Grace \] [C:\\data] [2] [Alan] [a "b"]
Chaque réglage ne lit juste que sa propre façon d'échapper, et ne signale rien sur l'autre : avec "\\", "a ""b""" perd la fin de sa valeur ; avec le défaut, \" coupe le nom.
Each setting only reads its own way of escaping correctly, and reports nothing on the other one: with "\\", "a ""b""" loses the end of its value; with the default, \" cuts the name.
trailing.csv : chaque ligne finit par ;. Schéma id, name, city ; Séparateur de lignes ";\n", affichage par le tJavaRow.
trailing.csv: each line ends with ;. Schema id, name, city; Row Separator ";\n", printed by the tJavaRow.
1;Ada;London;\n
2;Grace;Paris;\n
3;Alan;Manchester;\n
Scinder la ligne avant le champ décoché (défaut) :Split row before field unchecked (default):
[1] [Ada] [London] NB_LINE: 1
Coché :Checked:
[1] [Ada] [London] [2] [Grace] [Paris] [3] [Alan] [Manchester] NB_LINE: 3
Décoché, chaque ; est pris pour un séparateur de champs, et ";\n" n'est jamais trouvé : tout le fichier fait une seule ligne, dont les champs en trop sont ignorés.
Unchecked, each ; is taken as a field separator, and ";\n" is never found: the whole file makes a single row, whose extra fields are ignored.
twochars.csv contient 1||Ada||London\n. Séparateur de champs "||", sans puis avec options CSV, deux sous-jobs :
twochars.csv holds 1||Ada||London\n. Field Separator "||", without then with CSV options, two subjobs:
[1] [Ada] [London] [1] [] [Ada]
Avec les options CSV, seul le premier | sépare : un champ vide apparaît entre deux |, et les valeurs se décalent.
With the CSV options, only the first | separates: an empty field shows between two |, and the values shift.
amounts_fr.csv, nombres à la française. Schéma id, name, qty (Integer), amount (BigDecimal).
amounts_fr.csv, numbers in the French way. Schema id, name, qty (Integer), amount (BigDecimal).
1;Ada;1.200;1.250,50\n
2;Grace;80;80,00\n
3;Alan;1.000.000;3,14\n
Sans séparateur avancé :Without advanced separator:
Couldn't parse value for column 'qty' in 'row1', value is '1.200'. Details: java.lang.NumberFormatException: For input string: "1.200" Couldn't parse value for column 'amount' in 'row1', value is '80,00'. Details: java.lang.NumberFormatException: Character , is neither a decimal digit number, decimal point, nor "e" notation exponential mark. Couldn't parse value for column 'qty' in 'row1', value is '1.000.000'. Details: java.lang.NumberFormatException: For input string: "1.000.000" .--+----+---+------. | tLogRow_1 | |=-+----+---+-----=| |id|name|qty|amount| |=-+----+---+-----=| '--+----+---+------' NB_LINE: 3
Séparateur avancé coché, milliers ".", décimal "," :Advanced separator checked, thousands ".", decimal ",":
.--+-----+-------+-------. | tLogRow_1 | |=-+-----+-------+------=| |id|name |qty |amount | |=-+-----+-------+------=| |1 |Ada |1200 |1250.50| |2 |Grace|80 |80.00 | |3 |Alan |1000000|3.14 | '--+-----+-------+-------' NB_LINE: 3
Sans le réglage, toutes les lignes échouent ; chaque message ne nomme que la première colonne fautive. Without the setting, every row fails; each message only names the first wrong column.
dates.csv : une date juste, un 31 février, une date dans un autre format, une date entourée d'espaces. Schéma id (Integer), day (Date, "dd-MM-yyyy").
dates.csv: a correct date, a February 31, a date in another format, a date surrounded by spaces. Schema id (Integer), day (Date, "dd-MM-yyyy").
1;15-03-2021\n
2;31-02-2021\n
3;2021-03-15\n
4; 01-01-2020 \n
Par défaut :By default:
.--+----------. | tLogRow_1 | |=-+---------=| |id|day | |=-+---------=| |1 |15-03-2021| |2 |03-03-2021| |3 |10-09-0020| |4 |01-01-2020| '--+----------' NB_LINE: 4
Vérifier la date coché :Check date checked:
.--+----------. | tLogRow_1 | |=-+---------=| |id|day | |=-+---------=| |1 |15-03-2021| |4 |01-01-2020| '--+----------' NB_LINE: 4
Messages de la sortie d'erreur, avec la vérification :Error output messages, with the check:
Couldn't parse value for column 'day' in 'row1', value is '31-02-2021'. Details: java.lang.RuntimeException: Unparseable date: "31-02-2021" Couldn't parse value for column 'day' in 'row1', value is '2021-03-15'. Details: java.lang.RuntimeException: Unparseable date: "2021-03-15"
Par défaut, aucune erreur : le 31 février devient le 3 mars, et 2021-03-15 une date de l'an 20, sans avertissement. Les espaces autour d'une date sont toujours retirés. Vérifier la structure de chaque ligne donne la même sortie que Vérifier la date (essayé).
By default, no error: February 31 becomes March 3, and 2021-03-15 a date of year 20, without warning. The spaces around a date are always removed. Check each row structure gives the same output as Check date (tried).
spaces.csv, schéma id (Integer), name, city, affichage par le tJavaRow :
spaces.csv, schema id (Integer), name, city, printed by the tJavaRow:
1 ; Ada ;London \n
2;Grace ; Paris\n
Par défaut :By default:
Couldn't parse value for column 'id' in 'row1', value is ' 1 '. Details: java.lang.NumberFormatException: For input string: " 1 " [2] [Grace ] [ Paris] NB_LINE: 2
Supprimer les espaces… dans toutes les colonnes coché, avec ou sans options CSV :Trim all columns checked, with or without CSV options:
[1] [Ada] [London] [2] [Grace] [Paris] NB_LINE: 2
Case décochée, tableau des colonnes : id et name cochées, city non (job sans le tJava) :Box unchecked, column table: id and name checked, city not (job without the tJava):
[1] [Ada] [London ] [2] [Grace] [ Paris]
blanks.csv. Schéma : id (Integer), name (String, défaut "unknown"), city (String), qty (Integer, non nullable, sans défaut).
blanks.csv. Schema: id (Integer), name (String, default "unknown"), city (String), qty (Integer, not nullable, no default).
1;Ada;;5\n
2;;Paris;\n
Value is empty for column : 'qty' in 'row1' connection, value is invalid or this column should be nullable or have a default value. .--+----+----+---. | tLogRow_1 | |=-+----+----+--=| |id|name|city|qty| |=-+----+----+--=| |1 |Ada | |5 | '--+----+----+---' NB_LINE: 2
Même schéma, qty avec le défaut 0 :Same schema, qty with the default 0:
.--+-------+-----+---. | tLogRow_1 | |=-+-------+-----+--=| |id|name |city |qty| |=-+-------+-----+--=| |1 |Ada | |5 | |2 |unknown|Paris|0 | '--+-------+-----+---' NB_LINE: 2
La valeur par défaut remplace un champ vide, pour une String comme pour un nombre. Une colonne non nullable sans défaut met la ligne en erreur, avec ou sans options CSV (essayé les deux). The default value replaces an empty field, for a String as for a number. A non-nullable column without default puts the row in error, with or without CSV options (both tried).
codes.csv, schéma id, hex, num (Integer) :
codes.csv, schema id, hex, num (Integer):
1;0x1F;017\n
2;12;012\n
Par défaut :By default:
Couldn't parse value for column 'hex' in 'row1', value is '0x1F'. Details: java.lang.NumberFormatException: For input string: "0x1F" .--+---+---. |tLogRow_1 | |=-+---+--=| |id|hex|num| |=-+---+--=| |2 |12 |12 | '--+---+---' NB_LINE: 2
Autoriser l'hexadécimal… coché, hex et num cochées dans le tableau (job sans le tJava) :Permit hexadecimal… checked, hex and num checked in the table (job without the tJava):
.--+---+---. |tLogRow_1 | |=-+---+--=| |id|hex|num| |=-+---+--=| |1 |31 |15 | |2 |12 |10 | '--+---+---'
Attention au zéro devant : 012 vaut 12 sans le réglage, 10 avec.
Beware of the leading zero: 012 is 12 without the setting, 10 with it.
Le tJava_1 ouvre le fichier ; le tFileInputDelimited, En-tête 1, lit (java.io.InputStream) globalMap.get("in") :
tJava_1 opens the file; the tFileInputDelimited, Header 1, reads (java.io.InputStream) globalMap.get("in"):
globalMap.put("in", new java.io.FileInputStream(context.folder + "/people.csv"));
.--+-----+----------+-------+----------. | tLogRow_1 | |=-+-----+----------+-------+---------=| |id|name |city |amount |since | |=-+-----+----------+-------+---------=| |1 |Ada |London |1250.50|15-03-2021| |2 |Grace| |80.00 |02-11-2023| |3 |Alan |Manchester|3.14 |null | '--+-----+----------+-------+----------' NB_LINE: 3
Avec un Pied de page de 1, le job s'arrête : voir les erreurs. Fermez le flux vous-même après le sous-job. With a Footer of 1, the job stops: see the errors. Close the stream yourself after the subjob.
La ligne 1;Café 10 € dans trois fichiers (octets en hexadécimal). Schéma id (Integer), text (String) ; six sous-jobs qui se suivent, affichage par le tJavaRow :
The line 1;Café 10 € in three files (bytes in hexadecimal). Schema id (Integer), text (String); six subjobs one after the other, printed by the tJavaRow:
cafe_utf8.csv 31 3B 43 61 66 C3 A9 20 31 30 20 E2 82 AC 0A
cafe_bom.csv EF BB BF 31 3B 43 61 66 C3 A9 20 31 30 20 E2 82 AC 0A
cafe_latin.csv 31 3B 43 61 66 E9 20 31 30 20 A4 0A
cafe_utf8.csv, encodage par défaut (ISO-8859-15) ;cafe_utf8.csv, default encoding (ISO-8859-15);cafe_utf8.csv, "UTF-8" ;cafe_utf8.csv, "UTF-8";cafe_bom.csv, encodage par défaut ;cafe_bom.csv, default encoding;cafe_latin.csv, encodage par défaut ;cafe_latin.csv, default encoding;cafe_bom.csv, options CSV, encodage par défaut ;cafe_bom.csv, CSV options, default encoding;cafe_bom.csv, options CSV, "UTF-8".cafe_bom.csv, CSV options, "UTF-8".[1] [Café 10 â¬] [1] [Café 10 €] [1] [Café 10 €] [1] [Café 10 €] [1] [Café 10 €] [1] [Café 10 €]
1 : chaque octet UTF-8 devient un caractère (un caractère de contrôle invisible, 0082, est aussi entre â et ¬). 3, 5 et 6 : la marque d'ordre des octets fait lire le fichier en UTF-8 malgré le réglage, et ne gêne pas la lecture de id.
1: each UTF-8 byte becomes one character (an invisible control character, 0082, is also between â and ¬). 3, 5 and 6: the byte order mark makes the file read as UTF-8 despite the setting, and does not disturb the reading of id.
dynamic.csv, En-tête 1. Schéma : id (Integer), puis others (Dynamic) pour toutes les autres colonnes. Le tJavaRow affiche le nom et la valeur de chacune :
dynamic.csv, Header 1. Schema: id (Integer), then others (Dynamic) for all the other columns. The tJavaRow prints the name and value of each one:
id;first name;home.city\n
1;Ada;London\n
2;Grace;New York\n
routines.system.Dynamic d = input_row.others;
StringBuilder sb = new StringBuilder("id=" + input_row.id);
for (int i = 0; i < d.getColumnCount(); i++) {
sb.append(", ").append(d.getColumnMetadata(i).getName()).append("=").append(d.getColumnValue(i));
}
System.out.println(sb);
id=1, first_name=Ada, home_city=London id=2, first_name=Grace, home_city=New York NB_LINE: 3
Utiliser l'en-tête tel quel coché :Use Header As Is checked:
id=1, first name=Ada, home.city=London id=2, first name=Grace, home.city=New York NB_LINE: 3
Avec les options CSV en plus, même sortie que la première, mais NB_LINE vaut 2. With the CSV options as well, same output as the first one, but NB_LINE is 2.
tFileInputDelimited_begin.javajet fait lire l'en-tête comme une ligne pour la colonne Dynamic, tFileInputDelimited_end.javajet prend le compte du lecteur).
Without CSV options, NB_LINE counts the header line: 3 for 2 rows. Defect of the Talaxie template (tFileInputDelimited_begin.javajet makes the header be read as a row for the Dynamic column, tFileInputDelimited_end.javajet takes the count of the reader).
structure.csv, schéma id (Integer), name, city (String), sans en-tête : une ligne juste, une ligne trop courte, une ligne trop longue, un identifiant qui n'est pas un nombre, une ligne juste.
structure.csv, schema id (Integer), name, city (String), without header: a correct line, a line too short, a line too long, an identifier that is not a number, a correct line.
1;Ada;London\n
2;Grace\n
3;Alan;Manchester;UK\n
4x;Edsger;Rotterdam\n
5;Barbara;Paris\n
Réglages par défaut, affichage par le tJavaRow : Default settings, printed by the tJavaRow:
[1] [Ada] [London] [2] [Grace] [] [3] [Alan] [Manchester] Couldn't parse value for column 'id' in 'row1', value is '4x'. Details: java.lang.NumberFormatException: For input string: "4x" [5] [Barbara] [Paris] NB_LINE: 5
La ville manquante de Grace est une chaîne vide ([null] avec les options CSV, essayé), le champ UK en trop est ignoré ; seule la ligne 4x est écartée, avec un message sur la sortie d'erreur. NB_LINE compte les cinq lignes.
Grace's missing city is an empty string ([null] with the CSV options, tried), the extra UK field is ignored; only the 4x line is set aside, with a message on the error output. NB_LINE counts the five lines.
Vérifier la structure de chaque ligne coché. Les deux tLogRow, en mode Simple, affichent leur nom unique ; celui du Reject a les colonnes du flux, plus errorCode et errorMessage.
Check each row structure checked. Both tLogRow, in Basic mode, print their unique name; the Reject one has the flow columns, plus errorCode and errorMessage.
[tLogRow_1] 1|Ada|London [tLogRow_2] 2|Grace|||Column(s) missing - Line: 1 [tLogRow_2] 3|Alan|Manchester||Too many columns - Line: 2 [tLogRow_2] |Edsger|Rotterdam||Couldn't parse value for column 'id' in 'row1', value is '4x'. Details: java.lang.NumberFormatException: For input string: "4x" - Line: 3 [tLogRow_1] 5|Barbara|Paris NB_LINE: 5
Même sortie avec les options CSV (essayé). La ligne rejetée garde les valeurs déjà converties (id vide pour 4x). Line est le rang de la ligne parmi les lignes lues, en partant de 0, pas son numéro dans le fichier. errorCode reste toujours vide.
Same output with the CSV options (tried). The rejected row keeps the values already converted (empty id for 4x). Line is the rank of the row among the rows read, from 0, not its number in the file. errorCode always stays empty.
Même job, case décochée : seules les erreurs de conversion partent par le Reject. Same job, box unchecked: only conversion errors leave through the Reject.
[tLogRow_1] 1|Ada|London [tLogRow_1] 2|Grace| [tLogRow_1] 3|Alan|Manchester [tLogRow_2] |Edsger|Rotterdam||Couldn't parse value for column 'id' in 'row1', value is '4x'. Details: java.lang.NumberFormatException: For input string: "4x" - Line: 3 [tLogRow_1] 5|Barbara|Paris NB_LINE: 5
Le nom du job est remplacé par MyJob, le dossier de travail par C:\data ; les traces d'exception sont abrégées. La fin des messages de fichier vient de Windows, dans sa langue.
The job name is replaced with MyJob, the working folder with C:\data; exception traces are shortened. The end of the file messages comes from Windows, in its language.
Nom context.folder + "/absent.csv", réglages par défaut. Le tJava affiche NB_LINE et ERROR_MESSAGE :
Name context.folder + "/absent.csv", default settings. The tJava prints NB_LINE and ERROR_MESSAGE:
C:\data\absent.csv (Le fichier spécifié est introuvable) NB_LINE: null ERROR_MESSAGE: C:\data\absent.csv (Le fichier spécifié est introuvable)
La première ligne est sur la sortie d'erreur. Aucune ligne n'est lue, et pourtant le sous-job est réussi et le job se termine avec le code 0 ; de même avec les options CSV (essayé). Cochez Arrêter en cas d'erreur, ou vérifiez le fichier avant avec un tFileExist. The first line is on the error output. No row is read, yet the subjob succeeds and the job ends with exit code 0; the same with the CSV options (tried). Check Die on error, or check the file first with a tFileExist.
Même nom, Arrêter en cas d'erreur coché : le job s'arrête (code 1). Same name, Die on error checked: the job stops (exit code 1).
Exception in component tFileInputDelimited_1 (MyJob) java.io.FileNotFoundException: C:\data\absent.csv (Le fichier spécifié est introuvable) … at org.talend.fileprocess.TOSDelimitedReader.<init>(TOSDelimitedReader.java:88) at org.talend.fileprocess.FileInputDelimited.<init>(FileInputDelimited.java:164) …
structure.csv de l'exemple du lien Reject, Arrêter en cas d'erreur coché, un tLogRow en mode Simple : le job s'arrête (code 1) sur la ligne 4x, après avoir envoyé les trois premières.
structure.csv from the Reject link example, Die on error checked, a tLogRow in Basic mode: the job stops (exit code 1) on the 4x line, after sending the first three.
[tLogRow_1] 1|Ada|London [tLogRow_1] 2|Grace| [tLogRow_1] 3|Alan|Manchester Exception in component tFileInputDelimited_1 (MyJob) java.lang.RuntimeException: Couldn't parse value for column 'id' in 'row1', value is '4x'. Details: java.lang.NumberFormatException: For input string: "4x" at demo.myjob_0_1.MyJob.tFileInputDelimited_1Process(MyJob.java:887) … Caused by: java.lang.NumberFormatException: For input string: "4x" …
Avec en plus la vérification de la structure, il s'arrête dès la ligne 2 : With the structure check as well, it stops at line 2:
[tLogRow_1] 1|Ada|London Exception in component tFileInputDelimited_1 (MyJob) java.lang.RuntimeException: Column(s) missing at demo.myjob_0_1.MyJob.tFileInputDelimited_1Process(MyJob.java:913) …
Le job de l'exemple du flux, Pied de page 1 : le job s'arrête (code 1) avant de lire. The job of the stream example, Footer 1: the job stops (exit code 1) before reading.
Exception in component tFileInputDelimited_1 (MyJob) java.lang.Exception: When the input source is a stream,footer and random shouldn't be bigger than 0. at demo.myjob_0_1.MyJob.tFileInputDelimited_1Process(MyJob.java:1349) …
Sans Arrêter en cas d'erreur, un fichier absent ou des lignes mal converties ne font pas échouer le job : seuls des messages sur la sortie d'erreur les signalent. Dans un job planifié, cochez la case, ou reliez un lien Reject et comptez ses lignes. Without Die on error, a missing file or badly converted rows do not make the job fail: only messages on the error output report them. In a scheduled job, check the box, or connect a Reject link and count its rows.
Par défaut, une date impossible ou d'un autre format donne une autre date, sans erreur. Cochez Vérifier la date dès que les dates viennent d'une saisie ou d'un autre système. By default, an impossible date or one in another format gives another date, without error. Check Check date as soon as the dates come from user input or another system.
La plupart des fichiers récents sont en UTF-8 : réglez l'Encodage, sinon les accents sont faussés sans erreur. Seul un fichier avec une marque d'ordre des octets est lu juste sans réglage. Pour convertir un fichier, voir tChangeFileEncoding. Most recent files are in UTF-8: set the Encoding, otherwise accents are spoiled without error. Only a file with a byte order mark is read correctly without setting it. To convert a file, see tChangeFileEncoding.
Sans options CSV, l'expression du Nom de fichier/Flux est évaluée trois fois (vu dans le code généré). Écrire new java.io.FileInputStream(…) dans le champ ouvre donc trois flux, dont deux ne servent pas et ne sont jamais fermés. Défaut du modèle de Talaxie (tFileInputDelimited_begin.javajet, tFileInputDelimited_end.javajet). Ouvrez le flux avant, dans un tJava, comme dans l'exemple.
Without CSV options, the File name/Stream expression is evaluated three times (seen in the generated code). Writing new java.io.FileInputStream(…) in the field therefore opens three streams, two of which are unused and never closed. Defect of the Talaxie template (tFileInputDelimited_begin.javajet, tFileInputDelimited_end.javajet). Open the stream before, in a tJava, as in the example.
Une String vide reste une chaîne vide ; les autres types deviennent null. Donnez une valeur par défaut aux colonnes du schéma, ou testez row1.city.isEmpty() plus loin. Avec les options CSV, un champ manquant est null, même en String.
An empty String stays an empty string; the other types become null. Give a default value to the schema columns, or test row1.city.isEmpty() further on. With the CSV options, a missing field is null, even as a String.
Pour lire tous les fichiers d'un dossier, reliez un tFileList par Iterate et mettez ((String) globalMap.get("tFileList_1_CURRENT_FILEPATH")) dans le nom de fichier. Pour une archive, l'option zip lit tous ses fichiers d'un coup.
To read all the files of a folder, connect a tFileList with Iterate and put ((String) globalMap.get("tFileList_1_CURRENT_FILEPATH")) in the file name. For an archive, the zip option reads all its files at once.
Le composant ne vérifie que le type et, sur demande, le nombre de champs. Pour la longueur, les valeurs obligatoires ou le motif d'une date, placez un tSchemaComplianceCheck derrière lui, avec des colonnes String. The component only checks the type and, on request, the number of fields. For the length, mandatory values or the pattern of a date, put a tSchemaComplianceCheck behind it, with String columns.
Avec un Pied de page ou l'extraction au hasard, le fichier est lu deux fois. Sur un très gros fichier, préférez une Limite, ou écartez la ligne de total plus loin (un filtre sur une valeur connue). With a Footer or the random extraction, the file is read twice. On a very large file, prefer a Limit, or set aside the total line further on (a filter on a known value).
tFileOutputDelimited · écrire un fichier délimité ou CSVwrite a delimited or CSV filetFileInputFullRow · chaque ligne entière, sans découpageeach whole line, without splittingtFileInputPositional · fichier à positions fixesfixed-width filetFileInputRegex · lignes découpées par une expression régulièrelines split with a regular expressiontFileInputMSDelimited · fichier délimité à plusieurs schémasdelimited file with several schemastFileInputExcel · classeur ExcelExcel workbooktFileList · parcourir les fichiers d'un dossiergo through the files of a foldertSchemaComplianceCheck · contrôler les valeurs luescheck the values readtChangeFileEncoding · changer l'encodage d'un fichier textechange the encoding of a text filetFileRowCount · compter les lignes d'un fichiercount the lines of a file