<?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 [resolved] Using TMap to parse complex string in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-TMap-to-parse-complex-string/m-p/2323419#M93267</link>
    <description>I am new to TOS and to Java, so I am having a hard time figuring out how to parse out a string in TMap. I have a number of string columns in the input to the Tmap that should have a length of 5 be all numeric (e.g., '10101'). Unfortunately, sprinkled into columns are values like '3100'. The output still needs to have 5 columns, but the second column should have the value of ''. any ideas on how I can test for a non-numeric value and then take 3 characters for the column vs. using only 1 character?
&lt;BR /&gt;Thanks, John</description>
    <pubDate>Sat, 16 Nov 2024 13:35:03 GMT</pubDate>
    <dc:creator>jd8686</dc:creator>
    <dc:date>2024-11-16T13:35:03Z</dc:date>
    <item>
      <title>[resolved] Using TMap to parse complex string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-TMap-to-parse-complex-string/m-p/2323419#M93267</link>
      <description>I am new to TOS and to Java, so I am having a hard time figuring out how to parse out a string in TMap. I have a number of string columns in the input to the Tmap that should have a length of 5 be all numeric (e.g., '10101'). Unfortunately, sprinkled into columns are values like '3100'. The output still needs to have 5 columns, but the second column should have the value of ''. any ideas on how I can test for a non-numeric value and then take 3 characters for the column vs. using only 1 character?
&lt;BR /&gt;Thanks, John</description>
      <pubDate>Sat, 16 Nov 2024 13:35:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-TMap-to-parse-complex-string/m-p/2323419#M93267</guid>
      <dc:creator>jd8686</dc:creator>
      <dc:date>2024-11-16T13:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using TMap to parse complex string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-TMap-to-parse-complex-string/m-p/2323420#M93268</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;I am new to TOS and to Java, so I am having a hard time figuring out how to parse out a string in TMap...&lt;BR /&gt;The output still needs to have 5 columns, but the second column should have the value of ''. any ideas on how I can test for a non-numeric value and then take 3 characters for the column vs. using only 1 character?&lt;BR /&gt;Thanks, John&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;This sounds like a job for a regular expression! 
&lt;BR /&gt; 
&lt;A href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html&lt;/A&gt; 
&lt;BR /&gt;The Java reference is your friend. It has all the information you're looking for and more! If you've dealt with programming in other languages you may have dealt with some flavor of RegEx functionality. The below code snippet will match a single "value", being defined as a single digit optionally enclosed in square brackets. This wouldn't work if the number in the brackets could be several digits long - for instance, if "0110" is valid input, but it should be a good starting point. 
&lt;BR /&gt;There is an online tool for testing how given input strings would be parsed given a RegEx at 
&lt;A href="http://www.fileformat.info/tool/regex.htm" rel="nofollow noopener noreferrer"&gt;http://www.fileformat.info/tool/regex.htm&lt;/A&gt; 
&lt;BR /&gt;Good Luck! 
&lt;BR /&gt; 
&lt;PRE&gt;Pattern.compile("(\\?)+?")&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jan 2010 03:55:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-TMap-to-parse-complex-string/m-p/2323420#M93268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-30T03:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using TMap to parse complex string</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-TMap-to-parse-complex-string/m-p/2323421#M93269</link>
      <description>Andrew,
&lt;BR /&gt;Thanks for your help, especially the link to the Regex validation tool. I have not used Regex before, so it took a lot of experimenting to get just the expression just right. I am using tExtractRegexFields to parse my string into individual columns using the followng expression:
&lt;BR /&gt;"(|\\\\]|\"|\\*)(|\\\\]|\"|\\*)(|\\\\]|\"|\\*)(|\\\\]|\"|\\*)(|\\\\]|\"|\\*)(|\\\\]|\"|\\*)"
&lt;BR /&gt;John</description>
      <pubDate>Sat, 30 Jan 2010 23:04:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-TMap-to-parse-complex-string/m-p/2323421#M93269</guid>
      <dc:creator>jd8686</dc:creator>
      <dc:date>2010-01-30T23:04:09Z</dc:date>
    </item>
  </channel>
</rss>

