<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [resolved] pattern matching in tmap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307096#M78572</link>
    <description>OK I managed to solve it. 
&lt;BR /&gt;Set up code as follows 
&lt;BR /&gt;import java.util.regex.*; 
&lt;BR /&gt;public class patternmatch { 
&lt;BR /&gt; public static String matchPostCode (String input) { 
&lt;BR /&gt; Pattern postcode = Pattern.compile("^((?)|(?)|(()|(()))) ?{2}$"); 
&lt;BR /&gt; Matcher fit = postcode.matcher(input); 
&lt;BR /&gt; if (fit.matches()) { 
&lt;BR /&gt; return input; 
&lt;BR /&gt; } else { 
&lt;BR /&gt; return ""; 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt;and used rule like 
&lt;BR /&gt;patternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_1_1).trim()!=""?null:row1.Z304_DDR_REC_ADDR_1_1 
&lt;BR /&gt;for each of the address lines and 
&lt;BR /&gt;patternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_1_1).trim()!= ""? row1.Z304_DDR_REC_ADDR_1_1 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;atternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_2_1).trim() != ""? row1.Z304_DDR_REC_ADDR_2_1 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;atternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_3_1).trim() !=""? row1.Z304_DDR_REC_ADDR_3_1 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;atternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_4_1).trim() != ""? row1.Z304_DDR_REC_ADDR_4_1 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;atternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_5_1).trim() != ""? row1.Z304_DDR_REC_ADDR_5_1:row1.Z304_ADDR_REC_ZIP_1 
&lt;BR /&gt;for the zip code. 
&lt;BR /&gt;Seems to work ok.</description>
    <pubDate>Tue, 25 Aug 2009 17:13:02 GMT</pubDate>
    <dc:creator>janhess</dc:creator>
    <dc:date>2009-08-25T17:13:02Z</dc:date>
    <item>
      <title>[resolved] pattern matching in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307093#M78569</link>
      <description>I have an input file with 5 address fields. I need to be able to identify which field contains a uk postcode to map it to an output field called postcode. I downloaded the pattern match Valid UK Post Codes Upper and Lower Case.csv.zip from exchange 
&lt;BR /&gt;"'^ ((?)|((?)|(()|()))) ?{2}$'" 
&lt;BR /&gt; but can't figure out how to use it in a map rule. 
&lt;BR /&gt;Any help greatly appreciated.</description>
      <pubDate>Sat, 16 Nov 2024 13:48:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307093#M78569</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2024-11-16T13:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] pattern matching in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307094#M78570</link>
      <description>There is one way to proceed :
&lt;BR /&gt;Write a routine, with a method that will identify the postcode.
&lt;BR /&gt;public int identify_postcode(String adress_field_1, String adress_field_2, ... , String adress field_5) {
&lt;BR /&gt;// there you write the java code to test every field and extract the post code
&lt;BR /&gt;// convert the postcode to int type
&lt;BR /&gt;return postcode;
&lt;BR /&gt;}
&lt;BR /&gt;Then in the tmap, fill the field postcode with the expression :
&lt;BR /&gt;routine.identify_postcode(row1.adress1,row1.adress2,...,row1.adress5)
&lt;BR /&gt;Good luck</description>
      <pubDate>Tue, 25 Aug 2009 09:12:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307094#M78570</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-25T09:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] pattern matching in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307095#M78571</link>
      <description>Hi nKxxDV
&lt;BR /&gt;Thanks for the response. Unfortunately I'm not a Java developer. I had hoped there would be a way in Expression Builder to say something like
&lt;BR /&gt;if row1.address1 = pattern then row1.address1
&lt;BR /&gt;else if row1.address2 = pattern then row1.address2
&lt;BR /&gt;etc.</description>
      <pubDate>Tue, 25 Aug 2009 10:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307095#M78571</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2009-08-25T10:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] pattern matching in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307096#M78572</link>
      <description>OK I managed to solve it. 
&lt;BR /&gt;Set up code as follows 
&lt;BR /&gt;import java.util.regex.*; 
&lt;BR /&gt;public class patternmatch { 
&lt;BR /&gt; public static String matchPostCode (String input) { 
&lt;BR /&gt; Pattern postcode = Pattern.compile("^((?)|(?)|(()|(()))) ?{2}$"); 
&lt;BR /&gt; Matcher fit = postcode.matcher(input); 
&lt;BR /&gt; if (fit.matches()) { 
&lt;BR /&gt; return input; 
&lt;BR /&gt; } else { 
&lt;BR /&gt; return ""; 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt;and used rule like 
&lt;BR /&gt;patternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_1_1).trim()!=""?null:row1.Z304_DDR_REC_ADDR_1_1 
&lt;BR /&gt;for each of the address lines and 
&lt;BR /&gt;patternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_1_1).trim()!= ""? row1.Z304_DDR_REC_ADDR_1_1 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;atternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_2_1).trim() != ""? row1.Z304_DDR_REC_ADDR_2_1 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;atternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_3_1).trim() !=""? row1.Z304_DDR_REC_ADDR_3_1 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;atternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_4_1).trim() != ""? row1.Z304_DDR_REC_ADDR_4_1 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MAB6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158321i00588DF41617C922/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MAB6.png" alt="0683p000009MAB6.png" /&gt;&lt;/span&gt;atternmatch.matchPostCode(row1.Z304_DDR_REC_ADDR_5_1).trim() != ""? row1.Z304_DDR_REC_ADDR_5_1:row1.Z304_ADDR_REC_ZIP_1 
&lt;BR /&gt;for the zip code. 
&lt;BR /&gt;Seems to work ok.</description>
      <pubDate>Tue, 25 Aug 2009 17:13:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-pattern-matching-in-tmap/m-p/2307096#M78572</guid>
      <dc:creator>janhess</dc:creator>
      <dc:date>2009-08-25T17:13:02Z</dc:date>
    </item>
  </channel>
</rss>

