<?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 Help wanted: getting all values for a hexadecimal range (postal code) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Help-wanted-getting-all-values-for-a-hexadecimal-range-postal/m-p/2314915#M85629</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;We want to use a data file which contains dutch postalcode ranges. The data contains the fields Postalcode_from and Postalcode_to. These contain postalcodes like: 1234AA.&lt;/P&gt; 
&lt;P&gt;In many rows, the postalcode_from and postalcode_to are the same. However sometimes it has ranges&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;ostcode_from: 1234BB &amp;amp; postalcode_to: 1234BF. Now we need al the Postalcodes in this range like this (1234BB; 1234BC; 1234BD; 1234BE; 1234BF).&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Anyone an idea how to do this in Talend? Any help is realy appreciated.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you,&lt;/P&gt; 
&lt;P&gt;Remco&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2019 12:34:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-05-17T12:34:36Z</dc:date>
    <item>
      <title>Help wanted: getting all values for a hexadecimal range (postal code)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-wanted-getting-all-values-for-a-hexadecimal-range-postal/m-p/2314915#M85629</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;We want to use a data file which contains dutch postalcode ranges. The data contains the fields Postalcode_from and Postalcode_to. These contain postalcodes like: 1234AA.&lt;/P&gt; 
&lt;P&gt;In many rows, the postalcode_from and postalcode_to are the same. However sometimes it has ranges&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;ostcode_from: 1234BB &amp;amp; postalcode_to: 1234BF. Now we need al the Postalcodes in this range like this (1234BB; 1234BC; 1234BD; 1234BE; 1234BF).&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Anyone an idea how to do this in Talend? Any help is realy appreciated.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you,&lt;/P&gt; 
&lt;P&gt;Remco&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 12:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-wanted-getting-all-values-for-a-hexadecimal-range-postal/m-p/2314915#M85629</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-17T12:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help wanted: getting all values for a hexadecimal range (postal code)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-wanted-getting-all-values-for-a-hexadecimal-range-postal/m-p/2314916#M85630</link>
      <description>&lt;P&gt;This question interested me, so I decided to give it a go. I came up with this code.....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;//Inputs
String from = "1224AW";
String to = "1234CF";

//Identify components
String numFrom = from.substring(0, 4);
String firstCharFrom = from.substring(4, 5);
String secondCharFrom = from.substring(5, 6);
String numTo = to.substring(0, 4);
String firstCharTo = to.substring(4, 5);
String secondCharTo = to.substring(5, 6);

//Convert the numbers to ints
int intFrom = Integer.valueOf(numFrom).intValue();
int intTo = Integer.valueOf(numTo).intValue();

//Create an alphabet array
String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
List&amp;lt;Character&amp;gt; chars = new java.util.ArrayList&amp;lt;&amp;gt;(); 
for (char ch : alphabet.toCharArray()) { 
	chars.add(ch); 
} 

//Calculate range values and differences
int numDifference = intTo-intFrom;
int firstCharFromVal = chars.indexOf(firstCharFrom.charAt(0));
int firstCharToVal = chars.indexOf(firstCharTo.charAt(0));
int firstCharDifference = (chars.indexOf(firstCharTo.charAt(0))) - (chars.indexOf(firstCharFrom.charAt(0)));
int secondCharFromVal = chars.indexOf(secondCharFrom.charAt(0));
int secondCharToVal = chars.indexOf(secondCharTo.charAt(0));
int secondCharDifference = (chars.indexOf(secondCharTo.charAt(0))) - (chars.indexOf(secondCharFrom.charAt(0)));

//Sort issue where a from postcode's first character is greater than the to postcode's first character. 
//Example: 1234GH ---&amp;gt; 1235AA
if(firstCharDifference&amp;lt;0){
	firstCharDifference = (chars.indexOf('Z')) - (chars.indexOf(firstCharFrom.charAt(0)));
}	

//Sort issue where a from postcode's second character is greater than the to postcode's second character. 
//Example: 1234AH ---&amp;gt; 1234BA
if(secondCharDifference&amp;lt;0){
	secondCharDifference = (chars.indexOf('Z')) - (chars.indexOf(secondCharFrom.charAt(0)));	
}	

//Loop through numbers
for(int num = intFrom; num&amp;lt;=intTo; num++){
	//Loop through first characters
	for(int firstChar = 0; firstChar&amp;lt;=firstCharDifference; firstChar++){
	    //Loop through second characters
		for(int secondChar = 0; secondChar&amp;lt;=secondCharDifference; secondChar++){

			String postcode = num+Character.toString(chars.get((firstCharFromVal+firstChar)));
			postcode = postcode+Character.toString(chars.get((secondCharFromVal+secondChar)));
		   	//Print postcode
		   	System.out.println(postcode);
		   	
		}

		secondCharFromVal = 0;
		//In the last first character loop, set the second character to loop until to be the secondCharToVal
		if(firstChar==(firstCharToVal-1)){
			secondCharDifference = secondCharToVal;
		}else{
			secondCharDifference = 25;
		}
		
	}
	firstCharFromVal = 0;
	
	//In the last number loop, set the first character to loop until to be the firstCharToVal
	if(num==(intTo-1)){
		firstCharDifference = firstCharToVal;
	}else{
		firstCharDifference = 25;
	}

}&lt;/PRE&gt; 
&lt;P&gt;Try it in a tJava as it is and it will list all postcodes between 1224AW and 1234CF. You will need to modify it to get it to work for what you want.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;By the way, this is not the board for this question. I will move this question to the "Design and Development" board.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 16:23:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-wanted-getting-all-values-for-a-hexadecimal-range-postal/m-p/2314916#M85630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-17T16:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help wanted: getting all values for a hexadecimal range (postal code)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-wanted-getting-all-values-for-a-hexadecimal-range-postal/m-p/2314917#M85631</link>
      <description>Thank you very much! I will try your solution later this week and try to make it work in my Talend job.&lt;BR /&gt;Thanx! Remco&lt;BR /&gt;</description>
      <pubDate>Mon, 20 May 2019 15:19:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-wanted-getting-all-values-for-a-hexadecimal-range-postal/m-p/2314917#M85631</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-20T15:19:30Z</dc:date>
    </item>
  </channel>
</rss>

