Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Guys,
I'd like to open and parse a file such that when I parse, only lines with certain text in them get included into my array. How can I accomplish this? For example, let say that file contents are as follows: text in line 1 text in line 2 layer_1 layer_2 layer_3 I'd like to save the lines with layer_1, layer_2, and layer_3 in my array named line. Here's what I have so far - what should I do next? Sub geomsasciiparse() Dim Buf() As String Dim logical_layer As Variant Dim line() As String Dim objFSO As Object Dim objGeomsAsciiFile As Object Set objFSO = CreateObject("Scripting.FileSystemObject") Set objGeomsAsciiFile = objFSO.OpenTextFile(MentDesContPath & "\geoms_ascii") strBuffer = objGeomsAsciiFile.Readline Do While Not objGeomsAsciiFile.AtEndOfStream If InStr(strBuffer, "layer") = 1 Then End If Thanks for help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
number of lines and characters in a text file | Excel Programming | |||
Copying certain lines from a text file | Excel Discussion (Misc queries) | |||
Deleting text file lines | Excel Programming | |||
excel97 vba to append lines to text file overwriting last 2 lines | Excel Programming | |||
FileSystemObject to get last 10 lines of text file. | Excel Programming |