Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading file starting from 4th line

Status
Not open for further replies.

elly00

Technical User
Jun 30, 2011
69
0
0
IT
hi

I'm using this command in ordr to open a .csv file

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(File,ForReading)

All it's ok and works good.. My only problem is that I need to strat reading from the 4th line skipping line 1,2,3

Is that possibile?

thanks
!!!!!!!!!!!!!!!!!!!!!!!!!
 
How about this?
Code:
Dim sdata as String
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(File,ForReading)
objTextFile.ReadLine
objTextFile.ReadLine
objTextFile.ReadLine
Do Until objTextFile.AtEndOfStream
    sData = sData & objTextFile.ReadLine
Loop

"Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family." (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
:)
thanks!!!!!!!!!!!!!!!!!!!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top