keytotime Posted January 18, 2005 Share Posted January 18, 2005 How do you find a string in a file and then after that string insert a certain text on the next line. Link to comment Share on other sites More sharing options...
un4given1 Posted January 18, 2005 Share Posted January 18, 2005 can you give an example of where you are pulling data from, and what kind of output you desire? Link to comment Share on other sites More sharing options...
jdoe Posted January 18, 2005 Share Posted January 18, 2005 You can do this with a VBScript easily.With a FileSystemObject you can add lines in ASCII or Unicode text file.1) Open the file you want to edit2) Create a temp file3) Read you source file line by line4) Add those lines in your temp file5) When your text is found - InStr(FileLine,Text) - add the extra lines you want6) When source file is all red then close it and delete it7) Rename temp file as source file and that's itI can provide you sample code but if you're not familiar with VBScript, I don't think it will help. Link to comment Share on other sites More sharing options...
keytotime Posted January 18, 2005 Author Share Posted January 18, 2005 I'm trying to add two lines automatically to dosnet.inf and txtsetup.sif. I'm trying to add it under [Files] and [source disk files] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now