<?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: Looking for a concise way to perform the same several find/replace operators without specifying each column in a row in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297031#M69644</link>
    <description>&lt;P&gt;Let me know if it works for you. It is also possible to set the Talend context  variables with java reflection.&lt;/P&gt;&lt;P&gt;I wrote my own context loader this way, because the built in Talend functionality was not enough for me.&lt;/P&gt;&lt;P&gt;I also use this method to autoPropagate fields to copy the input_row to the output_row of a tJavaRow (which does not provide this feature).&lt;/P&gt;</description>
    <pubDate>Fri, 02 Oct 2020 15:18:23 GMT</pubDate>
    <dc:creator>cadap</dc:creator>
    <dc:date>2020-10-02T15:18:23Z</dc:date>
    <item>
      <title>Looking for a concise way to perform the same several find/replace operators without specifying each column in a row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297028#M69641</link>
      <description>&lt;P&gt;Use case is reading in a pipe delimited file via tInputFIleDelimited that hasn't got the best hygiene. What I want to be able to do is strip whitespace, double quotes, tabs, newlines, etc.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tReplace is clearly capable of this, but the catch is this: I need to do this in at least two workflows with two different schemas of around 40 columns apiece, and potentially in the future with longer rows than that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there's not a component that would be suitable, does Talend's internal structure for a row have an iterator I could use to iterate over the row in a tJavaRow and write some freeform code to do the replace? Pretty comfortable programming this out I'm just not too familiar with what Talend makes available to work with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 20:15:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297028#M69641</guid>
      <dc:creator>talEndOfTheWorld</dc:creator>
      <dc:date>2020-10-01T20:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a concise way to perform the same several find/replace operators without specifying each column in a row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297029#M69642</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know a Talend row is a normal  Java Class.&lt;/P&gt;&lt;P&gt;The attributes of the row are "hard coded" by reflection as variables of the class, so&lt;/P&gt;&lt;P&gt;you can use java reflection for this and encapsulate the functionality in a user routine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public static void cleanRow(Object row) throws Exception {&lt;/P&gt;&lt;P&gt;    String fieldName ="";&lt;/P&gt;&lt;P&gt;    for (Field field: row.getClass().getFields()) {&lt;/P&gt;&lt;P&gt;        fieldName = field.getName();&lt;/P&gt;&lt;P&gt;        System.&lt;I&gt;out&lt;/I&gt;.println("processing field: " + fieldName);        &lt;/P&gt;&lt;P&gt;        if (field.getType().equals(String.class) ) {&lt;/P&gt;&lt;P&gt;            String value = (String) field.get(row);&lt;/P&gt;&lt;P&gt;            if (value != null){&lt;/P&gt;&lt;P&gt;                //do your changes here&lt;/P&gt;&lt;P&gt;                value  = value.trim(); //e.g. trim&lt;/P&gt;&lt;P&gt;                field.set(row, value);&lt;/P&gt;&lt;P&gt;            }//if2&lt;/P&gt;&lt;P&gt;        }//if1&lt;/P&gt;&lt;P&gt;    }//for&lt;/P&gt;&lt;P&gt;}//method&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 09:33:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297029#M69642</guid>
      <dc:creator>cadap</dc:creator>
      <dc:date>2020-10-02T09:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a concise way to perform the same several find/replace operators without specifying each column in a row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297030#M69643</link>
      <description>&lt;P&gt;Thanks for the insight @Bernhard Gruber​, I'll give this approach a try and see what I come up with!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 13:07:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297030#M69643</guid>
      <dc:creator>talEndOfTheWorld</dc:creator>
      <dc:date>2020-10-02T13:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a concise way to perform the same several find/replace operators without specifying each column in a row</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297031#M69644</link>
      <description>&lt;P&gt;Let me know if it works for you. It is also possible to set the Talend context  variables with java reflection.&lt;/P&gt;&lt;P&gt;I wrote my own context loader this way, because the built in Talend functionality was not enough for me.&lt;/P&gt;&lt;P&gt;I also use this method to autoPropagate fields to copy the input_row to the output_row of a tJavaRow (which does not provide this feature).&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 15:18:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Looking-for-a-concise-way-to-perform-the-same-several-find/m-p/2297031#M69644</guid>
      <dc:creator>cadap</dc:creator>
      <dc:date>2020-10-02T15:18:23Z</dc:date>
    </item>
  </channel>
</rss>

