Group files with same name, different extension in a folder

mrkkrai
Member
Posts: 27
Joined: Thu Mar 17, 2016 4:31 pm

Group files with same name, different extension in a folder

Post by mrkkrai »

Hi:

I'm trying to create a flow which will do following:

1. Receives input (InDesign file) from client.
2. Creates PDF from original InDesign file, adds suffix (Job1_Client.pdf) and move to a folder (Softproof) already created in Production folder.
3. Further arranges original input in Production folder date-wise.
4. Later we make some changes in InDesign file manually. After that it creates PDF from changed InDesign file, adds suffix (Job1_Final.pdf) and move to Softproof folder.

I completed this part successfully but problem begins from here:

5. In Softproof folder, there are many files:

Job1_Client.pdf
Job1_Final.pdf
Job2_Client.pdf
Job2_Final.pdf
Job3_Client.pdf
Job3_Final.pdf
Job4_Client.pdf
Job4_Final.pdf

At this stage, I'm struggling to create a folder automatically name "Job1" and move "Job1_Client.pdf" and "Job1_Final.pdf" files. Same should be happen with all instances of files.

Here is the screenshot of what I created: http://postimg.org/image/aijjhrsn5/

Can someone please help on this?
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Group files with same name, different extension in a folder

Post by gabrielp »

Is Job1, Job2 your job number or do you want Switch to just create those based on a counter or something? If it's your job number, do you have "Job1" tagged in private data or metadata?
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.
mrkkrai
Member
Posts: 27
Joined: Thu Mar 17, 2016 4:31 pm

Re: Group files with same name, different extension in a folder

Post by mrkkrai »

"Job1" is the name of the job. It could be any thing like "Accessoires_Sandalen-Special" or something else.
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Group files with same name, different extension in a folder

Post by gabrielp »

So sounds like you could use "Set hierarchy path" and "Submit hierarchy" unless I'm interpreting this incorrectly.

"Set hierarchy path": set "Path segment 1" to Job1 (Accessoires_Sandalen-Special). Set "Path segment 2" to "Softproof" or whatever. Then pass that into "Submit hierarchy" with the "Path" set to the containing folder.
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.
mrkkrai
Member
Posts: 27
Joined: Thu Mar 17, 2016 4:31 pm

Re: Group files with same name, different extension in a folder

Post by mrkkrai »

Thanks for valuable help.

If I set "Path segment 1" to "Job folder name", it will work for only this folder. What should I do if get folders with another name as I'll be getting many folders with different names?
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: Group files with same name, different extension in a folder

Post by gabrielp »

mrkkrai wrote:If I set "Path segment 1" to "Job folder name", it will work for only this folder. What should I do if get folders with another name as I'll be getting many folders with different names?
I'm a little lost here, but it seems that if you have these values written in variables, then the variables can change, changing the folder you're archiving to. You'll want to figure out what you want to name the folders, then write those to variables. Then put those variables in the hierarchy configurators to get it to go in the correct place.
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.
mrkkrai
Member
Posts: 27
Joined: Thu Mar 17, 2016 4:31 pm

Re: Group files with same name, different extension in a folder

Post by mrkkrai »

I guess I was unable to explain my problem problem. I'm trying again...

I'm getting multiple zip files in input folder:
Image
Zip files contain files like this:
Image
I'm unarchiving and adding unique numbers (highlighted) as prefix to each job folder and InDesign file by "Rename job" like this:
Image
Using "Set hierarchy path", job folders are arranged in "Production" folder date-wise (dd-mm-yy):
Image
I create PDFs of InDesign files. PDFs move in a "hot folder" where a rip software converts them to TIFF and send back to Switch.

Bottlenecks:
1. Need to create a subfolder "[job_name]_softproof" inside job folder.
2. Need to move that TIFF file inside this subfolder.
Image

Here's my flow:

Image

I'm not using any XML/Metadata.

It seems very lengthy but I just add some screenshots to elaborate things better :)

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

Re: Group files with same name, different extension in a folder

Post by gabrielp »

Please don't make duplicate posts.

Your set hierarchy path should have: segment 1 as the date, segment 2 as the job folder (with the unique name you added), segment 3 as "Soft Proof". Then, you send that into a submit hierarchy which is the folder which contains all of the date folders (the ones from segment 1).
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.
mrkkrai
Member
Posts: 27
Joined: Thu Mar 17, 2016 4:31 pm

Re: Group files with same name, different extension in a folder

Post by mrkkrai »

Apologies for duplicate posts.

Here's my "Set hierarchy path" settings:
Image
Path segment 1 = [Switch.Date:Format="dd-mm-yy",TimeZone="System"]
Path segment 2 = [Job.NameProper]
Path segment 3 = [Job.NameProper]_Softproof

And it goes to Archive hierarchy (I guess as you told Submit hierarchy which Switch doesn't allow)
And the result is:
Image
The folder "[job.nameproper]_Softproof" is not created and pdf/tiff file is copied parallel to job folder.
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Group files with same name, different extension in a folder

Post by Terkelsen »

Oh, I just realized that this discussion is going on in several threads now. Please avoid that in the future.

The hierarchy path suggested by gabrielp should be added to the tiff-file, when it returns from GMG. The information you add in the first "Set hierarchy path" is lost, when the file is sent out of Switch to the RIP.

You would probably also need to delete the connection between "GMG IN" and "GMG OUT" as I assume these are hotfolders on your RIP. You don't want Switch to move the files between these two folders.
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Group files with same name, different extension in a folder

Post by Terkelsen »

... and make sure you allow at least three subfolder levels for the Archive Hierarchy.
mrkkrai
Member
Posts: 27
Joined: Thu Mar 17, 2016 4:31 pm

Re: Group files with same name, different extension in a folder

Post by mrkkrai »

My apologies for duplicate posts.

I made changes in flow and the result is:
Image
I want to move [job.nameproper]_Softproof folder inside the job folder (parallel to "Document fonts" & "Links" folder.

Thank you
mrkkrai
Member
Posts: 27
Joined: Thu Mar 17, 2016 4:31 pm

Re: Group files with same name, different extension in a folder

Post by mrkkrai »

Any luck to solve this?
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Re: Group files with same name, different extension in a folder

Post by Terkelsen »

What's the amount of subfolder levels set for your Archive Hierarchy?
mrkkrai
Member
Posts: 27
Joined: Thu Mar 17, 2016 4:31 pm

Re: Group files with same name, different extension in a folder

Post by mrkkrai »

Archive hierarchy's level is set to 3.
Post Reply