elite Posted February 21, 2006 Posted February 21, 2006 What is the best way to delete the first line of a text file? - I have csv's, but the first line is details the application that produced it I would like to remove this before it is imported into my database I know i could open it in wordpad (files are too big for notepad) and delete that way, but was wondering if there was a cleaner method that maybe didn't require a specific piece of software? Any help much appreciated cheers Nick
cdkid Posted February 21, 2006 Posted February 21, 2006 hhmm, _FileWriteToLine in my sig might help _FileWriteToLine("myfile.csv",1,"", 1) 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!
Valuater Posted February 21, 2006 Posted February 21, 2006 i am going to checkout cdkid's FilewriteToLine... but.. when i use a databse like that.. i just read from line #2 8)
cdkid Posted February 21, 2006 Posted February 21, 2006 hrm... i think there might be a problem with that, it will replace line 1 with "" but not delete it, so i might update it a little so it can delete lines. 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!
elite Posted February 21, 2006 Author Posted February 21, 2006 Wow speedy replies! - Thanks guysbut.. when i use a databse like that.. i just read from line #2Yeah, just wanted to try and tidy it up first before ftping it...hrm... i think there might be a problem with that, it will replace line 1 with "" but not delete it, so i might update it a little so it can delete lines.Indeed, nice little function - but if it could delete even better!ty
cdkid Posted February 21, 2006 Posted February 21, 2006 ok, i updated it so if you use _FileWriteToLine("myfile.csv",1,"",1) it should replace it ~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!
elite Posted February 21, 2006 Author Posted February 21, 2006 ok, i updated it so if you use _FileWriteToLine("myfile.csv",1,"",1) it should replace it ~cdkid You rock!
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