Pipe Delimited File Putting Quotes at Beggining & End of Row

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.

Pipe Delimited File Putting Quotes at Beggining & End of Row

Postby cderendinger » Tue Jan 14, 2014 11:45 am

I am trying to write a pipe delimited text file. I am able to write the file but there are quotes at the beginning and end of each row. How do I write the file without the quotes?

Christina
cderendinger
 
Posts: 5
Joined: Tue Jan 14, 2014 10:17 am

Re: Pipe Delimited File Putting Quotes at Beggining & End of

Postby Support_Rick » Tue Jan 14, 2014 11:56 am

Christina,

Please post the XML for your project here so that we can see what you're trying to do and help you correct it.

Or, email it to Support@Linoma.com and one of our Support Technicians will be glad to help!
Rick Elliott
Sr. Product Specialist
(402) 944.4242
(800) 949-4696
Support_Rick
Support Specialist
 
Posts: 145
Joined: Tue Jul 17, 2012 2:12 pm

Re: Pipe Delimited File Putting Quotes at Beggining & End of

Postby cderendinger » Tue Jan 14, 2014 12:24 pm

Below is the XML for the project that I am trying to create a pipe delimited file for.



Code: Select all
<project name="Phin Solutions Daily" mainModule="Main" version="2.0" logLevel="debug">

   <module name="Main" logLevel="debug">

      <createWorkspace version="1.0" />


      <timestamp version="1.0">
         <format outputVariable="today" pattern="MM-dd-yy" />
      </timestamp>


      <setVariable name="fileDate" value="${today}" version="2.0" />


      <sql resourceId="IBM iSeries" version="1.0" disabled="false">
         <query outputVariable="deleteFile">
            <statement>select * from scdata.phinfle</statement>
         </query>
         <query outputVariable="textFile">
            <statement>select * from scdata.phinfle2</statement>
         </query>
      </sql>


      <writeCSV inputRowSetVariable="${deleteFile}" outputFile="berlin_wheeler${fileDate}-o.del" fieldDelimiter="pipe" textQualifier="none" outputFileVariable="deleteFile2" version="1.0" />


      <writeCSV inputRowSetVariable="${textFile}" outputFile="berlin_wheeler${fileDate}-o.csv" fieldDelimiter="pipe" textQualifier="none" applyTextQualifierTo="all" outputFileVariable="textFile2" version="1.0" />


      <rename inputFile="${deleteFile2}" newName="l_berlin_wheeler${fileDate}.del" outputFilesVariable="deleteFile3" version="1.0" disabled="false" />


      <rename inputFile="${textFile2}" newName="l_berlin_wheeler${fileDate}.txt" outputFilesVariable="textFile3" version="1.0" disabled="false" />


      <copy destDir="resource:smb://BWMOSBS/Linoma/" whenFileExists="overwrite" version="1.0" disabled="false">
         <fileset dir="${system.job.workspace}" />
      </copy>


      <sftp resourceId="Phin Solutions" version="1.0" disabled="true">
         <put sourceFile="{delFile}" destinationDir="/inbox/" processedSourceFilesVariable="filesout" />
         <put sourceFile="${txtFile}" destinationDir="/inbox/" />
      </sftp>


      <sendEmail resourceId="Berlin Email" toList="cderendinger@bwmo.com" version="2.0">
         <from address="info@bwmo.com" />
         <subject>
            <![CDATA[Phin Solutions Daily File]]>
         </subject>
         <attachment file="${deleteFile2}" />
         <attachment file="${textFile3}" />
      </sendEmail>


      <deleteWorkspace version="1.0" />

   </module>

</project>
cderendinger
 
Posts: 5
Joined: Tue Jan 14, 2014 10:17 am

Re: Pipe Delimited File Putting Quotes at Beggining & End of

Postby cderendinger » Tue Jan 14, 2014 1:40 pm

Here is the XML for the project I have setup.

Code: Select all
<project name="Phin Solutions Daily" mainModule="Main" version="2.0" logLevel="debug">

   <module name="Main" logLevel="debug">

      <createWorkspace version="1.0" />


      <timestamp version="1.0">
         <format outputVariable="today" pattern="MM-dd-yy" />
      </timestamp>


      <setVariable name="fileDate" value="${today}" version="2.0" />


      <sql resourceId="IBM iSeries" version="1.0" disabled="false">
         <query outputVariable="deleteFile">
            <statement>select * from scdata.phinfle</statement>
         </query>
         <query outputVariable="textFile">
            <statement>select * from scdata.phinfle2</statement>
         </query>
      </sql>


      <writeCSV inputRowSetVariable="${deleteFile}" outputFile="berlin_wheeler${fileDate}-o.del" fieldDelimiter="pipe" textQualifier="none" outputFileVariable="deleteFile2" version="1.0" />


      <writeCSV inputRowSetVariable="${textFile}" outputFile="berlin_wheeler${fileDate}-o.csv" fieldDelimiter="pipe" textQualifier="none" applyTextQualifierTo="all" outputFileVariable="textFile2" version="1.0" />


      <rename inputFile="${deleteFile2}" newName="l_berlin_wheeler${fileDate}.del" outputFilesVariable="deleteFile3" version="1.0" disabled="false" />


      <rename inputFile="${textFile2}" newName="l_berlin_wheeler${fileDate}.txt" outputFilesVariable="textFile3" version="1.0" disabled="false" />


      <copy destDir="resource:smb://BWMOSBS/Linoma/" whenFileExists="overwrite" version="1.0" disabled="false">
         <fileset dir="${system.job.workspace}" />
      </copy>


      <sftp resourceId="Phin Solutions" version="1.0" disabled="true">
         <put sourceFile="{delFile}" destinationDir="/inbox/" processedSourceFilesVariable="filesout" />
         <put sourceFile="${txtFile}" destinationDir="/inbox/" />
      </sftp>


      <sendEmail resourceId="Berlin Email" toList="cderendinger@bwmo.com" version="2.0">
         <from address="info@bwmo.com" />
         <subject>
            <![CDATA[Phin Solutions Daily File]]>
         </subject>
         <attachment file="${deleteFile2}" />
         <attachment file="${textFile3}" />
      </sendEmail>


      <deleteWorkspace version="1.0" />

   </module>

</project>
cderendinger
 
Posts: 5
Joined: Tue Jan 14, 2014 10:17 am

Re: Pipe Delimited File Putting Quotes at Beggining & End of

Postby Support_Rick » Tue Jan 14, 2014 2:14 pm

Christina,

A few things stand out in your XML script:

1- Your writeCSV tasks create 2 file variables ( deleteFile2 & textFile2 )
2- Your rename tasks renames those 2 files and creates corresponding variables ( deleteFile3 & textFile3 )
3- Your sftp task puts 2 files onto the "Phis Solutions" server as:

Code: Select all
      <sftp resourceId="Phin Solutions" version="1.0" disabled="true">
         <put sourceFile="{delFile}" destinationDir="/inbox/" processedSourceFilesVariable="filesout" />
         <put sourceFile="${txtFile}" destinationDir="/inbox/" />
      </sftp>


**NOTE** I know this is disabled, but .. just following the logic through your script.

{delFile} : Does not have a $ in front to make it a variable and is not defined within your XML
${txtFile} : Is not defined within your XML

4- Your sendEmail task attaches 2 file variables ( deleteFile2 & textFile3 ) -- these may be incorrect increments to attach. Not sure.

==================

What is it you are seeing in your output Files that is incorrect?
Also, do not forget you can add Data Options to your columns read from your IBMi Tables while writing to the writeCSV Task.
Do the values you're selecting from the Table already have DoubleQuotes attached?

Can you email us at Support@Linoma.com with examples of your data (before & after) so we can see what is happening?
Rick Elliott
Sr. Product Specialist
(402) 944.4242
(800) 949-4696
Support_Rick
Support Specialist
 
Posts: 145
Joined: Tue Jul 17, 2012 2:12 pm


Return to Community Forum

Who is online

Users browsing this forum: No registered users and 2 guests