Search for files and take

Post Reply
RytisT
Member
Posts: 135
Joined: Fri Aug 17, 2018 3:18 pm

Search for files and take

Post by RytisT »

Hi. I want to create a pretty simple flow in switch.

From time to time, there's an order that requires taking old files and just printing them again, but there are loads of files of that order which are all marked with it's own number.

I'd like to be able to make a .txt or .csv or .xml file with numbers inside it like
"...
11
23
46
..."

and for switch to search for files with 11,23,46 in their names and sending down the line from a specific folder. Is this possible? Thanks.
jan_suhr
Advanced member
Posts: 591
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Search for files and take

Post by jan_suhr »

Yes it is quite simple.

Make one XML-file for each file you will pickup and use the Inject Job tool to get the job file.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
RytisT
Member
Posts: 135
Joined: Fri Aug 17, 2018 3:18 pm

Re: Search for files and take

Post by RytisT »

jan_suhr wrote: Mon Feb 10, 2020 8:19 am Yes it is quite simple.

Make one XML-file for each file you will pickup and use the Inject Job tool to get the job file.
Well yeah, but there's like 50 files, making 50 XML's by hand won't be faster than just picking the files themselves.

Any way to make a single .txt file with all file names in it and for switch to split up that txt into single-line xml's?
jan_suhr
Advanced member
Posts: 591
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Search for files and take

Post by jan_suhr »

Well then you need a bit of XSLT to split up the incoming XML to 50 single files.

If you have the Scripting Module you can do everything with a Script
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
RytisT
Member
Posts: 135
Joined: Fri Aug 17, 2018 3:18 pm

Re: Search for files and take

Post by RytisT »

jan_suhr wrote: Mon Feb 10, 2020 8:33 am Well then you need a bit of XSLT to split up the incoming XML to 50 single files.

If you have the Scripting Module you can do everything with a Script
I don't :(

No other way?
jan_suhr
Advanced member
Posts: 591
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Search for files and take

Post by jan_suhr »

Well, As I said use XSLT to split up the incoming XML in one XML-file per job you want to pickup and use the Inject Job where you read the XML to get the file and path to get the file.

You don't need Scripting for that but you need the Metadata module.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
RytisT
Member
Posts: 135
Joined: Fri Aug 17, 2018 3:18 pm

Re: Search for files and take

Post by RytisT »

jan_suhr wrote: Mon Feb 10, 2020 9:02 am Well, As I said use XSLT to split up the incoming XML in one XML-file per job you want to pickup and use the Inject Job where you read the XML to get the file and path to get the file.

You don't need Scripting for that but you need the Metadata module.
Oh, thanks.

I can't seem to find any documentation from Enfocus on how to use XSLT element. Am I supposted to create a stylesheet as a template on how every XML file is going to be split? Thank you.
jan_suhr
Advanced member
Posts: 591
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Search for files and take

Post by jan_suhr »

Yes and XSLT that splits each item to a new XML-file.

If you Google it you'll find how to do it.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
RytisT
Member
Posts: 135
Joined: Fri Aug 17, 2018 3:18 pm

Re: Search for files and take

Post by RytisT »

jan_suhr wrote: Mon Feb 10, 2020 9:33 am Yes and XSLT that splits each item to a new XML-file.

If you Google it you'll find how to do it.
Okay, thank you!
Malcolm Mackenzie
Member
Posts: 121
Joined: Wed Mar 22, 2017 5:05 pm
Location: London, UK
Contact:

Re: Search for files and take

Post by Malcolm Mackenzie »

These might do it for you

Allows a CSV to be a lookup table
https://www.enfocus.com/en/appstore/product/list-lookup

One xml can be looped to created as many lines as in the file.
https://www.enfocus.com/en/appstore/pro ... l-repeater
laurentd
Member
Posts: 140
Joined: Wed Mar 13, 2019 2:06 pm

Re: Search for files and take

Post by laurentd »

Here is another app to loop in an xml file:
https://www.enfocus.com/en/appstore/pro ... able-xpath

And if you want to inject a job in your flow, and you only have part of the name, you need this one:
https://www.enfocus.com/en/appstore/pro ... t-wildcard
Laurent De Wilde, Solution Architect @ Enfocus
Post Reply