How to count the rows in a rowset variable
Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
How to count the rows in a rowset variable
We retrieve a file via SFTP, then read it with the Read CSV task. There is no output variable for the number of records read. Is there a way to determine the number of records in the rowset before proceeding? Currently when the file is empty (no rows), the read CSV task completes successfully, but the next step to insert the records into a database fails.
- Support_Rick Offline
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
- Contact:
Re: How to count the rows in a rowset variable
Troy,
The quick answer is, there is no "reccount" var attached to the read CSV.
This is one quick way to check.
Do a "Search and Replace" in the file of the CRLF (or LF--depending on End of record marker). Replace it with the same thing.
For example:
<searchAndReplace inputFile="MyInboundFile.csv" outputDir="${system.job.workspace}" searchFor="${system.carriageReturn}${system.lineFeed}" replaceWith="${system.carriageReturn}${system.lineFeed}" numReplacementsVariable="NoRecs" version="1.0" />
When finished, you should have a variable called "NoRecs" that contains the number of Records (End of Record Markers) that was changed... which should give you the record count.
Hope this helps!
The quick answer is, there is no "reccount" var attached to the read CSV.
This is one quick way to check.
Do a "Search and Replace" in the file of the CRLF (or LF--depending on End of record marker). Replace it with the same thing.
For example:
<searchAndReplace inputFile="MyInboundFile.csv" outputDir="${system.job.workspace}" searchFor="${system.carriageReturn}${system.lineFeed}" replaceWith="${system.carriageReturn}${system.lineFeed}" numReplacementsVariable="NoRecs" version="1.0" />
When finished, you should have a variable called "NoRecs" that contains the number of Records (End of Record Markers) that was changed... which should give you the record count.
Hope this helps!
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696