text file editing
Hi,
I have a requiredment where i need to read one line in a text file, compare it with a string and replace the next 4 lines with another set of 4 lines. Can some one tell me how to go about it.
Regards
I have a requiredment where i need to read one line in a text file, compare it with a string and replace the next 4 lines with another set of 4 lines. Can some one tell me how to go about it.
Regards
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
airwolf
14 years ago
Which scripting language(s) are you familiar with? A fairly simple AutoIT script could be written to perform this task, and VBScript would be a viable option as well - there are other scripting languages you could also use. If you require assistance with a script, then post your source code so we can help you out. If you're asking someone to write the script for you, then good luck. You may be able to find something similar to this that you can tweak a bit to your needs. If you are up for using AutoIT, then search their forums and I'm sure you'll find something to suit your needs.
Posted by:
kiran_i_rao
14 years ago
Posted by:
kiran_i_rao
14 years ago
Posted by:
airwolf
14 years ago
Right, it will take a bit of modification, but not much. Are you or any of your coworkers familiar with VBS? If not, you may need to do some reading about the basics - and you may be able to find some other scripts to chop up by doing some Googling. I found that article by Googling "vbs find replace". You just need to modify it to replace the next few lines after the search return... So you'd perform the search, assign the line # found to a variable, and then do a few WriteLines to $variable + 1, $variable + 2, etc.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.