Regular formulas

Good morning everyone,
I can’t use regular formulas

I have all the files containing:

Work09Document2022”se_meta”:9001
Work09Document2022”se_meta”:9002
Work09Document2022”se_meta”:9003
Work09Document2022”se_meta”:9004
Work09Document2022”se_meta”:9005
.
.
.
(and so on)

I basically have to look for initials
(Wildcard)“se_meta”:90

And I have to replace

Work09Document2023”se_meta”:90

Thanks for your help

Roberto Grigis

Hi @Luca_Smith

Have you tried with Rename Files

image

Regards
Gokul

Thanks Gokul001,
no rename the file…

but replace inside the file.

Hi @Luca_Smith

Try this:

Read Text File
For Each item in Collection
    item = System.Text.RegularExpressions.Regex.Replace(item, "Work09Document2022""se_meta"":90[0-9]+", "Work09Document2023""se_meta"":90")
    Append Text File (if needed)
1 Like

Hi @Luca_Smith ,

Could you maybe explain a bit more as to what is required, the provided requirement is not very understandable.

Do you want to perform a renaming of the file ?If so, Example after the renaming is done would help us provide proper suggestions.

For the REGEX program or also NOTEPAD++

Thanks and best regards

Thanks for the reply, what you wrote, what program was it from?

@Luca_Smith

Use for each to iterate through file names
Use assign activity to replace the file name using regex.
item = System.Text.RegularExpressions.Regex.Replace(item, "Work09Document2022""se_meta"":90[0-9]+", "Work09Document2023""se_meta"":90")

@Luca_Smith

Assign searchString = “se_meta":90”
Assign replaceString = “Work09Document2023"se_meta":90”
Assign directoryPath = “path_to_your_directory”

Assign filePaths = Directory.GetFiles(directoryPath)

For Each filePath In filePaths
Assign fileContents = File.ReadAllText(filePath)
Assign fileContents = fileContents.Replace(searchString, replaceString)
File.WriteAllText(filePath, fileContents)
End For Each

I don’t understand what program you use?

Hi @Luca_Smith

Welcome to Community!!

Please check the below xaml

BlankProcess12.zip (45.4 KB)

O/P:

image

Hope this helps!!

Thanks for your kind help

but I don’t know how to use xaml, please explain to me in detail why I don’t know that extension.

Thank you

@Luca_Smith


->For Each File in Folder
       ->Read Text File
       ->TextFile=System.Text.RegularExpressions.Regex.Replace(TextFile.ToString, ".*""se_meta"":90", "Work09Document2023""se_meta"":90")
      ->Write Text File

Main.xaml (11.7 KB)

Sorry Main.xaml where do you open from?
I don’t see how you attached the image?

Is there any software?