QA Stooge Posted February 22, 2006 Share Posted February 22, 2006 (edited) I want to be able to, using File***(***) commands... - insert text at some line in a file - get a count for the number of lines in a file without traversing the whole thing - delete a line in a file - overwrite a line in a file There a script that can do this sort of thing? Edited February 22, 2006 by QA Stooge Link to comment Share on other sites More sharing options...
cdkid Posted February 22, 2006 Share Posted February 22, 2006 (edited) well for numbers 1, 3, and 4 look at _FileWriteToLine in my sig, as for counting lines look at _FileCountLines in the help file ~cdkid ;For deleting line 3 of a text file _FileWriteToLine("c:\myfile.txt", 3, "", 1) ;For overwriting line 3 of a text file _FileWriteToLine("c:\myfile.txt", 3, "My Replacement For Line 3", 1) ;for inserting text at line 3 _FileWriteToLine("c:\myfile.txt", 3, "Insert this where line 3 is and line 3 will move down 1 as will the rest of the lines", 0) Edited February 22, 2006 by cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
Valuater Posted February 22, 2006 Share Posted February 22, 2006 for #2 use _FileCountLines 8) Link to comment Share on other sites More sharing options...
QA Stooge Posted February 22, 2006 Author Share Posted February 22, 2006 (edited) You guys are gods. Or at least saints. Or at the VERY least, "kika$$OMFGLOLZ!!11!11!!!!!one!!!!eleven111!!" Thanks a bunch!!! Edited February 22, 2006 by QA Stooge Link to comment Share on other sites More sharing options...
randallc Posted February 23, 2006 Share Posted February 23, 2006 Hi, Also for huge files if too slow with usual AutoIt, consider; 1. _DeleteFoundLineDOS($s_file,$s_Exclude) (see doscoms link in signature) 2. WriteLineSQLSimple.au3 (see SQL UDF link in signature) Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW 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