Jump to content
Sign in to follow this  
Legion4400

string search and replace/add

Recommended Posts

Legion4400

hello. im a beginer at autoit so i need some help.

i have multiple files in one folder. in each file, between the lines i have some lines that look like this

task = task0013

some other lines 

task = task6435

and so on. 

the number after string task are not in ascendin or descending order. Now in another file "A" that is located in other folder i have the name is each of those taskxxxx, it looks like this

[task0013]
name=whatever
[task6452]
name=...
.................
 
what i want to do is a script that will search in each file for task(xxxx) then search in the file "A" for same string and replace in the first file from folder so it will look like this
 

task = task0013

name=whatever

some other lines 

task = task6435

name = ...

I hope u guys understand , i dont know how else to explain. Thank you

 

Share this post


Link to post
Share on other sites
Muzaiyan

Use IniRead() in file management help section to manage your INI Files.

Use StringReplace() function to made string replacements.

start it by your self it is not too difficult and don't be too lazy.

I hope we will see you with a piece of code soon. :)

Share this post


Link to post
Share on other sites
Legion4400

do i have to make a loop within a loop to search in all files and then search all the strings in each file?

Share this post


Link to post
Share on other sites
Muzaiyan

you will need many loops according to your requirement

1 to find for files

1 to read section names

1 to compare/replace values e.t.c

Your practice is very important than our help

Share this post


Link to post
Share on other sites
Legion4400

i did it by editing the file a bit , and then with notepad++ and a small autoclicker i added the lines.

Share this post


Link to post
Share on other sites
MikahS

Can you post what you have done so far script wise?

  • Like 1

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×