Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Management of processing file

Hello,

 

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

 

Date=06072015_174419

Plage= 1000Hz à 10000Hz

Climat = Froid

Commentaire = Commentaire

 

Information…

 

 

They are 3 types of climat : Climat  = Chaud or Climat = Ambiant, and it's this case that I want to see.

 

Solution  :

tFileList

  Directory: « D:/_users/BMI/Test »

  « *.csv »

tFileDelimited

  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.

 

Best regards

BastienM

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

You're welcome.
Don't forget to mark the topic as solved if it is (for people searching for the same subject).
Kudos also accepted!

View solution in original post

6 Replies
TRF
Champion II
Champion II

Hi Bastien,

 

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:

0683p000009LvZF.png

Connect tFilterRow to tLogRow to see the result, you should receive only the desired records.

Hope this helps.

 

 

Anonymous
Not applicable
Author

Hi TRF,

 

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.

 

Best regards

BastienM

TRF
Champion II
Champion II

Connect tFileCopy to tFilterRow using a "If" trigger like this:

0683p000009Lveh.png

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".

Anonymous
Not applicable
Author

Hello,

 

I don't understand the usage of the component tFixedFlow because it haven't directory, so I used this solution :

 

tFileList_1 :

Directory : "D:/_users/BMI/test"

Files : "*.dat"

 

tFileInputDelimitedt_1 :

Flow's name :

((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

 

tFilterRow_1 :

column0          Vide           Vaut            "Climat = Froid"

 

IF :

Condition :

((Interger)globalMap.get("tFilterRow_1_NB_LINE_OK")) > 0

tFileCopy_1 :

File's name :

((String)globalMap.get("tFileDelimited_1_CURRENT_FILEPATH"))

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.

 

Best regards

BastienM

 

Anonymous
Not applicable
Author

I find my issue, now I test for 2 results. I contact you if I have an another issue.

 

Thanks

BastienM

TRF
Champion II
Champion II

You're welcome.
Don't forget to mark the topic as solved if it is (for people searching for the same subject).
Kudos also accepted!