I need to parse a | pipe-delimited text file to exclude lines which
contain a certain numerical value

Here is a sample:
#90053 | 6480| 90000| 100000| | 343| 0| 0|
|
|#90665 | 8| 0| 102400| | 2| 0| 0|
|
|

Now, assuming I can figure out how to parse this file, I need to factor
in a *nix password file which will take the #90xxx number and give me a
text user name. I need to take these excluded users and remove their
entries in an excel file.

I am lost.

Any help out there?

I've gotten some good stuff from here in the past...

Re: Parsing files by McKirahan

McKirahan
Tue Sep 13 18:13:51 CDT 2005

"GAZ" <gregzook@yahoo.com> wrote in message
news:1126650398.773091.70700@g43g2000cwa.googlegroups.com...
> I need to parse a | pipe-delimited text file to exclude lines which
> contain a certain numerical value
>
> Here is a sample:
> #90053 | 6480| 90000| 100000| | 343| 0| 0|
> |
> |#90665 | 8| 0| 102400| | 2| 0| 0|
> |
> |
>
> Now, assuming I can figure out how to parse this file, I need to factor
> in a *nix password file which will take the #90xxx number and give me a
> text user name. I need to take these excluded users and remove their
> entries in an excel file.
>
> I am lost.
>
> Any help out there?
>
> I've gotten some good stuff from here in the past...
>

How does "#90xxx number and give me a text user name"?


Perhaps the following will get you started. Watch for word-wrap.

Option Explicit

Const cOTF = "file_with_pipes.txt"

Dim arrOTF
Dim intOTF
Dim strOTF

Dim objFSO
Dim objOTF

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOTF = objFSO.OpenTextFile(cOTF,1)
arrOTF = Split(objOTF.ReadAll,vbCrLf)
Set objOTF = Nothing
Set objFSO = Nothing

For intOTF = 0 To UBound(arrOTF)
strOTF = Split(arrOTF(intOTF),"|")
If Left(strOTF(0),3) = "#90" Then
WScript.Echo strOTF(0)
End If
Next



Re: Parsing files by GAZ

GAZ
Thu Sep 15 07:23:28 CDT 2005

Yes, that got me started...

Thanks.