Delete headers from csv file and export to a txt file

Hi guys:
Im trying to create a simple utility using vb.net console application that will generate a exe. That I will trigger after 3 files have been exported to a directory. The utility will look for 3 files: RTI.csv, TLG.csv and ALP.csv, will open the files take the first row out which is a header and then resave or export it to a TXT file, renaming them to RTI.txt, TLG.txt and ALP.txt. of course with not header and not leaving a gap or empty space were the header was. Im a sql developer just with some experience in vb.net. I read that I can use a dataset to do this but not to sure how to, I will really appreciate any tips or ideas.

Thanks A lot!
Oneill0003Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
Hi Oneill0003,

The quickest and easiest way is probably to use something like this....

        Dim FolderPath As String = "C:\"
        Dim FileNames() As String = {"RTI.csv", "TLG.csv", "ALP.csv"}
        For Each File As String In FileNames
            Dim sr As New StreamReader(FolderPath & File)
            Dim FileText As String = sr.ReadToEnd
            sr.Close()
            Dim sw As New StreamWriter(FolderPath & File.Replace("csv", "txt"), False)
            sw.Write(FileText.Substring(FileText.IndexOf(vbLf)))
            sw.Close()
        Next

Regards,

Wayne
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Oneill0003Author Commented:
Hi Webtubbs:
I apologies for the delay I did try your code and it was a great help.
Thanks for the help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.