Just nu i M3-nätverket
Jump to content

FileSystemObject


Strigge

Recommended Posts

Kan man välja hur många rader man vill visa med FileSystemObject om man har en text som sträcker sig över flera rader?

 

Sen har jag en fråga till. Jag har en annan textfil där det är mellanrum mellan raderna. När jag kör den visas bara texten fram till mellanrummet. Hur löser jag det?

Link to comment
Share on other sites

Du kan använda metoden ReadLine och Skipline.

 


Set R = fso.OpenTextFile(fileObject)

Dim Text
Text = ""

'Läs allt till rad 15
Do Until R.Line = 15
Text = Text & R.ReadLine
Loop

'Skippa tills rad 20
Do Until R.Line = 20
R.SkipLine
Loop

'Skippa 4 rader
For I to 4
R.SkipLine
Next

'Skriv text
Response.Write "Text till rad 15:<br>" & Text

 

/JANspeed

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...