I have an issue of a technical process and I don't find a solution on the web.
The issue :
I have a folder including numerous DAT files in the format CSV, however all are not useful for me. For that purpose, I wish to read a case (cell) of these (all have the same formatting) then according to the result. I decide or not to copy this file somewhere else with the same name.
File example :
Name: 2015-07-06 Seq_001
Plage= 1000Hz à 10000Hz
Climat = Froid
Commentaire = Commentaire
They are 3 types of climat : Climat = Chaud or Climat = Ambiant, and it's this case that I want to see.
Directory: « D:/_users/BMI/Test »
« *.csv »
Flow's name : ((String)globalMap.get(“tFile_CURRENT_FILEPATH »)).
I don't find any idea for the contuation, can you help me ?
While waiting, I continue to search.
Solved! Go to Solution.
Configure the tFileInputDelimited like this to read only the 3rd line:
- Field separator = "="
- Header = 2
- Limit = 1
Set the schema as FieldName string and FieldValue string.
Add a tFilterRow after tFileInputDelimited and configure it like this:
Connect tFilterRow to tLogRow to see the result, you should receive only the desired records.
Hope this helps.
Actually, I want to check this result, but my final aim is to copy this file with the same name with tFileCopy or an another component.
So, how I can access at this achievement with the result of tFilterRow.
Connect tFileCopy to tFilterRow using a "If" trigger like this:
and write the condition like this:
((Integer)globalMap.get("tFilterRow_1_NB_LINE_OK")) > 0
The copy will apply only if 1 record is equal to "Ambiant".
I don't understand the usage of the component tFixedFlow because it haven't directory, so I used this solution :
Directory : "D:/_users/BMI/test"
Files : "*.dat"
Flow's name :
column0 Vide Vaut "Climat = Froid"
((Interger)globalMap.get("tFilterRow_1_NB_LINE_OK")) > 0
File's name :
Directory : "D:/_users/BMI/test2"
However, when I execute my job, I have the message :
Démarrage du job experience a 13:25 24/07/2017. [statistics] connecting to socket on port 3545 [statistics] connected Exception in component tFileCopy_1 java.lang.NullPointerException at java.io.File.<init>(Unknown Source) at freqnum_bm.experience_0_1.experience.tFileCopy_1Process(experience.java:1491) at freqnum_bm.experience_0_1.experience.tFileList_1Process(experience.java:1355) at freqnum_bm.experience_0_1.experience.runJobInTOS(experience.java:1776) at freqnum_bm.experience_0_1.experience.main(experience.java:1633) [statistics] disconnected Job experience terminé à 13:25 24/07/2017. [Code sortie=1]
PS: my Talend Open Studio is in French.