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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
DrGenious
Creator
Creator

User Insert

Hi,

I want to ask from a user to input a string and then this string to be searched inside a file in order to see if it is exists  . Thank you .

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,

 

   You can check like below.

0683p000009M8Kg.png

 

In this example, I am having an input file as shown below and I am checking whether the string "name" is present in that file. The name to be searched is assigned to a context variable and you can pass value to context variable during run time (check other Talend articles to know about it).

 

0683p000009M8Ld.pnginput file

Now I am reading the entire file using tFileInput Raw as a string0683p000009M8DV.png

 

0683p000009M8Ln.png

 

0683p000009M8BK.png

 

in tMap, you can check whether string exists using java contains() function.

 

Hope I answered your query 🙂

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

View solution in original post

2 Replies
NIKISUBHADIP
Contributor II
Contributor II

You can take user input in form of context variable.In the below screenshot you can see one check box under default column is checked.It means when you run the job it will ask input from user .If there is no input given then it will take the default value else the value given by user,Here in this case it will take CONN1 as default value assigned to context variable CONN_OPTION

 

After this you can use the context variable corresponding which the value is assigned  to search the match in a file.

 

0683p000009M80R.jpg

Anonymous
Not applicable

Hi,

 

   You can check like below.

0683p000009M8Kg.png

 

In this example, I am having an input file as shown below and I am checking whether the string "name" is present in that file. The name to be searched is assigned to a context variable and you can pass value to context variable during run time (check other Talend articles to know about it).

 

0683p000009M8Ld.pnginput file

Now I am reading the entire file using tFileInput Raw as a string0683p000009M8DV.png

 

0683p000009M8Ln.png

 

0683p000009M8BK.png

 

in tMap, you can check whether string exists using java contains() function.

 

Hope I answered your query 🙂

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved