Clear Filters
Clear Filters

How to replace multiple strings in a txt file and keep the original format

1 view (last 30 days)
Hi all, my problem is how to replace multiple strings in a txt file and keep its original format; the original file is
Section = 1
*Lookhere
10
Dont Lookhere
Section = 2
*Lookhere
20
Dont Lookhere
the post changed file is
Section = 1
*Lookhere
1000
Dont Lookhere
Section = 2
*Lookhere
2000
Dont Lookhere
So i must localize the n (* Lookhere) argument and i read the n numbers just after this argument and i store them in a vector to change them via a function (*100 for example) and i re write the file with the same original format
Tanks at advance

Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!