File count to report writing

Post Reply
cwhiteley
Newbie
Posts: 6
Joined: Fri Dec 14, 2018 1:56 pm

File count to report writing

Post by cwhiteley »

Hello All,

I'm trying to get a count of the number of records within the csv files being placed into the input for my switch flow then output this count into an excel report.

Multiple different files can be placed into the flow throughout the day and ideally I would get a final count of each file into one report at the end of the day and have that sent out.

Could someone help point me in the right direction on how to do this?

Many Thanks
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: File count to report writing

Post by jan_suhr »

In the File class you have a function readLines()

Search in the Scripting manual for "lines"
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
r.zegwaard
Member
Posts: 93
Joined: Fri Jul 08, 2011 10:31 am
Location: The Netherlands

Re: File count to report writing

Post by r.zegwaard »

First you should write a scripts which processes the incomming files. It should open the csv-file and read the number of lines in it.
Then append this number and the job-name in another csv-file. Both number and the job-name should be on the same line and separated by a comma, tab or semi-colon.

Then add an "inject job" to your flow and configure it to inject the created csv-file at a "time of day"

Robert
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: File count to report writing

Post by gabrielp »

This script/app counts on line breaks using the method Jan mentioned above:
- https://github.com/open-automation/switch-count-rows
- https://www.enfocus.com/en/appstore/product/count-rows
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore

Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
cwhiteley
Newbie
Posts: 6
Joined: Fri Dec 14, 2018 1:56 pm

Re: File count to report writing

Post by cwhiteley »

Thanks all :)
Post Reply