Sign in to follow this  
Followers 0
elite

Delete first line of text file

7 posts in this topic

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

Share this post


Link to post
Share on other sites



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!

Share this post


Link to post
Share on other sites

i am going to checkout cdkid's FilewriteToLine...

but.. when i use a databse like that.. i just read from line #2

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Wow speedy replies! - Thanks guys

but.. when i use a databse like that.. i just read from line #2

Yeah, 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

Share this post


Link to post
Share on other sites

ok, i updated it so if you use

_FileWriteToLine("myfile.csv",1,"",1)

it should replace it

:o

~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!

Share this post


Link to post
Share on other sites

ok, i updated it so if you use

_FileWriteToLine("myfile.csv",1,"",1)

it should replace it

:geek:

~cdkid

You rock! :o

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  
Followers 0