Returning employee ID as File name PDF
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi all, qq
Ive recently picked up a project from an ex colleague where we separate PDF files by employee ID. Its not something that Im overly familiar with having focused mainly on Excel based flows.
We have a PDF file with employee docs, where the employees ID is in a set position on every doc. We use alteryx to split the file into individual docs.
The employee number appears as follows on the PDF
We use the following to convert the number into text for the purpose of file renaming - it creates a text called EE ID
At the moment its returning the first four digits and naming the new file accordingly - so the sample file would be "Doc_2132_Month" when the process closes
However I would like the name to be "Doc_144442_Month", basically ignoring the 2132 / 0 (returning the last 6 digits)
As a process it is running and closing out fine, its just I cant get the name to target the 144442 part
Can you advise on a solution?
Dave
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If I'm understanding the question right then the following should work:
\/\s0(\d+)
Alternatively, this is more dynamic and will just parse the last 6 digits:
.*(\d{6})
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you - is there a way to generalize it? The 2132 part can be a number of 4 digit combinations (the remainder is static)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @Dave,
The solution I would use is to use a Regex expression like this in the parse tool:
Employee:.*\/\s*(\d+)
And output it as an integer to make sure there are no zeros at the beginning, then convert to a string with a select tool.
HTH,
Ira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry @Dave, made an edit as you were reading I believe! The second is more dynamic, it basically skips over everything until the last 6 digits in the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This worked perfectly - thank you so much :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Slight update and question -
is there a way to stop the process running on pages where it doesnt find the "Employee:" qualifier. Right now its generating a file with no employee number for those pages. Id rather it produced nothing
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Dave could you add a filter like this and only continue the process for the true output :
Contains([Files Name],"Employee:")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Dave before your output that produces the PDFs, could you not just chuck a filter in that checks !isnull([EE ID]) and then have the output coming from the 'True' anchor?
