Page 1 of 1

Pipe Delimited File Putting Quotes at Beggining & End of Row

Posted: Tue Jan 14, 2014 11:45 am
by cderendinger
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

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

Posted: Tue Jan 14, 2014 11:56 am
by Support_Rick
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!

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

Posted: Tue Jan 14, 2014 12:24 pm
by cderendinger
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>

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

Posted: Tue Jan 14, 2014 1:40 pm
by cderendinger
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>

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

Posted: Tue Jan 14, 2014 2:14 pm
by Support_Rick
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?

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

Posted: Wed Aug 20, 2014 8:12 am
by wfpturner
Was there ever a solution posted for this problem? I am encountering the same issue using the WRITECSV task to create a pipe-delimited text file. Some of the output records are completely enclosed in quotes. As an example, my output file will look like this:

Field1|Field 2|Field 3|Field 4
"Field1|Field 2|Field 3|Field 4"
"Field1|Field 2|Field 3|Field 4"
Field1|Field 2|Field 3|Field 4
"Field1|Field 2|Field 3|Field 4"
Field1|Field 2|Field 3|Field 4

It appears to be random as to which records are enclosed in quotes. I've analyzed the input data file and cannot see any reason or pattern as to why the quotes are there for some records.

Thanks.

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

Posted: Wed Aug 20, 2014 9:50 am
by Support_Rick
Yes,

The user was using an incorrect Variable (Variable Name) thus the issue was associated to that.

We would need to see your XML file and review that to give you any indication of what's going on with your project. A snapshot of a few lines from the Source File would be an added bonus toward helping.

Thanks!