how to skip a line

Posted on 2003-04-01
Medium Priority
Last Modified: 2010-05-01
if i have a text file, how would i do to skip the first line :
20390312.00,10/7/2002 0:00:00,0,10/6/2002 23:58:39
20390979.00,10/7/2002 0:00:00,0,10/7/2002 0:02:38
20391106.00,10/7/2002 0:00:00,0,10/7/2002 0:01:59
20391641.00,10/7/2002 0:00:00,0,10/7/2002 0:05:05

how would start by 20390312?
Question by:Jhar
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8247170
dim tmp as string
line input #1, tmp

and then read the rest of the file

Expert Comment

ID: 8247288
LVL 10

Accepted Solution

aeklund earned 80 total points
ID: 8247291
Assuming you want to read this file from VB, here is a sample:

Dim lLine as Long
Dim sLine as String
Dim sAllLines as String
Dim sFile as String
Open sFile For Input as #1
  Do Until EOF(1)
  lLine = lLine + 1
  Line Input #1, sLine
  If lLine > 1 Then
    sAllLines = sAllLines & sLine & vbCrLf
  End If

Close #1

Debug.Print sAllLines 'Minus the First Line of course

Author Comment

ID: 8247480
Thx dude a appreciate
it was really easy to understand
LVL 10

Expert Comment

ID: 8247640
No problem.. glad to help.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question