<?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] appending/inserting tSystem Output to a (log) file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-appending-inserting-tSystem-Output-to-a-log-file/m-p/2258737#M40453</link>
    <description>Ok, I found a way. But if anyone knows of an easier way to do this, I am all ears!
&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;If Link&lt;/U&gt;&lt;/B&gt;
&lt;U&gt;&lt;/U&gt;
&lt;BR /&gt;
&lt;PRE&gt;!((String)globalMap.get("tSystem_1_OUTPUT")).equals(null)&lt;BR /&gt;|| &lt;BR /&gt;!(((String)globalMap.get("tSystem_1_ERROROUTPUT")) == null)&lt;BR /&gt;|| &lt;BR /&gt;!(((String)globalMap.get("tSystem_1_ERROR_MESSAGE")) == null)&lt;/PRE&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;tJavaFlex_1&lt;/U&gt;&lt;/B&gt;
&lt;U&gt;&lt;/U&gt;
&lt;BR /&gt;*Advanced Settings
&lt;BR /&gt;***Import
&lt;BR /&gt;
&lt;PRE&gt;import java.io.*;&lt;/PRE&gt;
&lt;BR /&gt;*Basic Settings
&lt;BR /&gt;***Start code
&lt;BR /&gt;
&lt;PRE&gt;Writer output = null;&lt;BR /&gt;File file = new File(context.BatchLogFile);&lt;BR /&gt;output = new BufferedWriter(new FileWriter(file, true));&lt;/PRE&gt;
&lt;BR /&gt;***Main code
&lt;BR /&gt;
&lt;PRE&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("********************************************************************************************************");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("Start Date/Time= " + TalendDate.getCurrentDate());&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;if ( !((String)globalMap.get("tSystem_1_OUTPUT")).equals(null) ) {&lt;BR /&gt;	output.write("------------------------------------Standard Output-------------------------------------");&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;	output.write(((String)globalMap.get("tSystem_1_OUTPUT")));&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;}&lt;BR /&gt;if ( !(((String)globalMap.get("tSystem_1_ERROROUTPUT")) == null) ) {&lt;BR /&gt;	output.write("--------------------------------------Error Output--------------------------------------");&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;	output.write(((String)globalMap.get("tSystem_1_ERROROUTPUT")));&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;}&lt;BR /&gt;if ( !(((String)globalMap.get("tSystem_1_ERROR_MESSAGE")) == null) ) {&lt;BR /&gt;	output.write("--------------------------------------Error Message-------------------------------------");&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;	output.write(((String)globalMap.get("tSystem_1_ERROR_MESSAGE")));&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;}&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("End Date/Time= " + TalendDate.getCurrentDate());&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("********************************************************************************************************");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;/PRE&gt;
&lt;BR /&gt;***End code
&lt;BR /&gt;
&lt;PRE&gt;output.close();&lt;/PRE&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;Related Information&lt;/U&gt;&lt;/B&gt;
&lt;U&gt;&lt;/U&gt;
&lt;BR /&gt;
&lt;A href="http://www.roseindia.net/java/beginners/WriteTextFileExample.shtml" rel="nofollow noopener noreferrer"&gt;http://www.roseindia.net/java/beginners/WriteTextFileExample.shtml&lt;/A&gt;
&lt;BR /&gt;
&lt;A href="http://www.roseindia.net/java/example/java/io/java-append-to-file.shtml" rel="nofollow noopener noreferrer"&gt;http://www.roseindia.net/java/example/java/io/java-append-to-file.shtml&lt;/A&gt;
&lt;BR /&gt;
&lt;A href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/Writer.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/io/Writer.html&lt;/A&gt;
&lt;BR /&gt;
&lt;A href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedWriter.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedWriter.html&lt;/A&gt;
&lt;BR /&gt;
&lt;A href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileWriter.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileWriter.html&lt;/A&gt;
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;FileWriter(String fileName, boolean append) &lt;BR /&gt;Constructs a FileWriter object given a file name with a boolean indicating whether or not to append the data written.&lt;BR /&gt;boolean append values: true, false&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Tue, 30 Sep 2008 21:17:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-09-30T21:17:54Z</dc:date>
    <item>
      <title>[resolved] appending/inserting tSystem Output to a (log) file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-appending-inserting-tSystem-Output-to-a-log-file/m-p/2258736#M40452</link>
      <description>I'm trying to figure out how to append the value of ((String)globalMap.get("tSystem_1_OUTPUT")) to an output file.  I've got my standard and error outputs both going "to global variable."&lt;BR /&gt;I originally thought maybe I could use a tFixedFlowInput, but the other issue to contend with is that my standard output has the potential to be large... like, according to a text editor i used to look at one set of output (see 3rd pic):   Byte count = 95,923</description>
      <pubDate>Sat, 16 Nov 2024 14:12:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-appending-inserting-tSystem-Output-to-a-log-file/m-p/2258736#M40452</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] appending/inserting tSystem Output to a (log) file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-appending-inserting-tSystem-Output-to-a-log-file/m-p/2258737#M40453</link>
      <description>Ok, I found a way. But if anyone knows of an easier way to do this, I am all ears!
&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;If Link&lt;/U&gt;&lt;/B&gt;
&lt;U&gt;&lt;/U&gt;
&lt;BR /&gt;
&lt;PRE&gt;!((String)globalMap.get("tSystem_1_OUTPUT")).equals(null)&lt;BR /&gt;|| &lt;BR /&gt;!(((String)globalMap.get("tSystem_1_ERROROUTPUT")) == null)&lt;BR /&gt;|| &lt;BR /&gt;!(((String)globalMap.get("tSystem_1_ERROR_MESSAGE")) == null)&lt;/PRE&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;tJavaFlex_1&lt;/U&gt;&lt;/B&gt;
&lt;U&gt;&lt;/U&gt;
&lt;BR /&gt;*Advanced Settings
&lt;BR /&gt;***Import
&lt;BR /&gt;
&lt;PRE&gt;import java.io.*;&lt;/PRE&gt;
&lt;BR /&gt;*Basic Settings
&lt;BR /&gt;***Start code
&lt;BR /&gt;
&lt;PRE&gt;Writer output = null;&lt;BR /&gt;File file = new File(context.BatchLogFile);&lt;BR /&gt;output = new BufferedWriter(new FileWriter(file, true));&lt;/PRE&gt;
&lt;BR /&gt;***Main code
&lt;BR /&gt;
&lt;PRE&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("********************************************************************************************************");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("Start Date/Time= " + TalendDate.getCurrentDate());&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;if ( !((String)globalMap.get("tSystem_1_OUTPUT")).equals(null) ) {&lt;BR /&gt;	output.write("------------------------------------Standard Output-------------------------------------");&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;	output.write(((String)globalMap.get("tSystem_1_OUTPUT")));&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;}&lt;BR /&gt;if ( !(((String)globalMap.get("tSystem_1_ERROROUTPUT")) == null) ) {&lt;BR /&gt;	output.write("--------------------------------------Error Output--------------------------------------");&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;	output.write(((String)globalMap.get("tSystem_1_ERROROUTPUT")));&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;}&lt;BR /&gt;if ( !(((String)globalMap.get("tSystem_1_ERROR_MESSAGE")) == null) ) {&lt;BR /&gt;	output.write("--------------------------------------Error Message-------------------------------------");&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;	output.write(((String)globalMap.get("tSystem_1_ERROR_MESSAGE")));&lt;BR /&gt;	output.write("\n");&lt;BR /&gt;}&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("End Date/Time= " + TalendDate.getCurrentDate());&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("********************************************************************************************************");&lt;BR /&gt;output.write("\n");&lt;BR /&gt;output.write("\n");&lt;/PRE&gt;
&lt;BR /&gt;***End code
&lt;BR /&gt;
&lt;PRE&gt;output.close();&lt;/PRE&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;Related Information&lt;/U&gt;&lt;/B&gt;
&lt;U&gt;&lt;/U&gt;
&lt;BR /&gt;
&lt;A href="http://www.roseindia.net/java/beginners/WriteTextFileExample.shtml" rel="nofollow noopener noreferrer"&gt;http://www.roseindia.net/java/beginners/WriteTextFileExample.shtml&lt;/A&gt;
&lt;BR /&gt;
&lt;A href="http://www.roseindia.net/java/example/java/io/java-append-to-file.shtml" rel="nofollow noopener noreferrer"&gt;http://www.roseindia.net/java/example/java/io/java-append-to-file.shtml&lt;/A&gt;
&lt;BR /&gt;
&lt;A href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/Writer.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/io/Writer.html&lt;/A&gt;
&lt;BR /&gt;
&lt;A href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedWriter.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedWriter.html&lt;/A&gt;
&lt;BR /&gt;
&lt;A href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileWriter.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileWriter.html&lt;/A&gt;
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;FileWriter(String fileName, boolean append) &lt;BR /&gt;Constructs a FileWriter object given a file name with a boolean indicating whether or not to append the data written.&lt;BR /&gt;boolean append values: true, false&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 30 Sep 2008 21:17:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-appending-inserting-tSystem-Output-to-a-log-file/m-p/2258737#M40453</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-09-30T21:17:54Z</dc:date>
    </item>
  </channel>
</rss>

