Hi,
I have a couple of files created on one drive that all have an ending ... .pdf
Example: File1.pdf, File2.pdf, etc.
How can I get rid of the .pdf from the file name for all of my files at once?
Best regards,
Ludwig
Hi @Anonymous
Is there any particular reason why you want to remove the file extension?
Regards,
Fausto Capellan, Jr
Hi,
Yes, my files have the vendor ID included.
Example: V123, V456
I want to use this info in a subsequent step to search for the correct vendor contact.
This does not work if the files are saved as
V123.pdf or V456.pdf
Best regards,
Ludwig
Hi @Anonymous,
Do you want to search correct vendor contact based on vendor ID, such as, V123, V456, etc?
Do you want to remove the extension name of the PDF file and store them as V123 or V456 in your OneDrive folder?
Further, could you please show a screenshot of your flow's configuration?
I think it is not necessary to remove the extension name of PDF files and store them as V123 or V456 in your OneDrive folder for searching correct vendor contact. In addition, if you remove the extension name of these files, the Content type of these files would be changed.
You could consider take a try to get the file name which doesn't include extension name using Microsoft Flow, such as, V123, V456, etc. I have created some PDF files within my OneDrive folder, the screenshot as below:
I have made a test on my side and please take a try with the following workaround:
first(split(items('Apply_to_each')?['DisplayName'],'.'))
Note: The above formula within Compose action is used to get the file name which doesn't include extension name.
Image reference:
The flow works successfully as below:
In addition, renaming file action is not supported in OneDrive connector, if you want to rename files on your OneDrive folder, please take a try with the following workaround:
first(split(items('Apply_to_each')?['DisplayName'],'.'))
Add a "Get file content" action, File field set to Id dynamic content of "List files in folder" action. Then add a "Create file" action, specify Folder Path, File Name field set to output of "Compose" action, File Content field set to File content dynamic content of "Get file content" action.
Add a "Delete file" action, File field set to Id dynamic content of "List files in folder" action.
Image reference:
The flow works successfully as below:
Best regards,
Kris
thank you very much for taking the time to explain how to separate a file name and its extension - works a treat in a slightly different context.
Hi @Anonymous
I'm glad the solution helped you achieve your solution.
Regards,
Fausto Capellan, Jr
User | Count |
---|---|
23 | |
15 | |
14 | |
10 | |
9 |
User | Count |
---|---|
45 | |
29 | |
26 | |
25 | |
22 |