Rename Files

Have files with this format 81052478301_187404_H_UL0YN.PDF

I would like everything cut off after the _H but include the ext

Thank You in advance.

Hello,

try this (with filepath as your original filepath):

newFilename = System.Text.RegularExpressions.Regex.Replace(filepath, "_H_.*.PDF", ".PDF")

2 Likes

varOldFileName=“81052478301_187404_H_UL0YN.PDF”

varNewFileName=varOldFileName.Substring(0,varOldFileName.IndexOf(“H”))

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.