I have text file. i need to identify multiple patten in it.
------------------------------------
eg.
data : 100
tax : 300
hardware: 400
cost : 2000
------------------------------------
similar data will be in other files also.
so i have to write 4 regular expressions
like
1. ****
2. ****
3. ****
4. ****
how do i do that in talend.
an Example will be good.
Thanks
I think you need to explain in more detail why you need to do this. For example, if it is to identify rows holding the data and extract it, you can simply use Java String methods to identify the row from finding "data" in the text and then extract the number from the string a row at a time using a tMap, for example. You can of course use a regex to do this, but from what you have given you may as well just search for the leading word (data, tax, hardware, cost).
Hi,
I didn't quite understand you(as I am new to talend).Can you give me an example???
I ll explain my problem again,
as you can see in image (Highlited red) i wrote a regular expression and I am getting results for it.For my project I need only few values from that file. say i need 5 values from file and i have to write 5 separate regex for that.can I do that in talend and how???
Thanks,
Pankaj
Whatever you are wanting to do to extract data from your file, YES you can do it with Talend. The problem I have is that your requirement is not clear. I cannot see the image that you say you have added. Maybe that will make things a bit clearer for me.
from this file i need to extract flight date ,PERIODE,REF and 1-37 records and insert it into DB. so basically i need to put flight date ,PERIODE,REF for each record .(i ll need 37 row from above file (space separates values))
Take a look at the tFileInputRegex and the tFileInputMSDelimited. You can do this with both, it just depends on how you want to achieve it and whether the structure of your file will be consistent.
Hi,
can i match regex over multiple lines
e.g
file:
Invoice Number:
A123 Invoice Date:
20-Aug-14 Aircraft:
A123-301 Sample airline
and i want to extract these fileds(bold once) ... how can i do that???
and yes my file structure will be same for every file.
i tried using tFileInputRegex and the tFileInputMSDelimited.
i tried with this Regex ...
**:\s*(*)\s*.****\s*(+).**\s*(*)
Thanks,
Pankaj