OK, don't laugh
I know this is probably easy for some of ya.
I'm trying to read in a large text file line by line, break it into variables and then do some filtering etc.
The file is space delimited. I do smth like this:
Open "c:\CrspVBA.txt" For Input As #1
Do While Not EOF(1)
'Read one line and then break it into variables
Input #1, PERMCO, PERMNO, NCUSIP, SICL, Ticker, Symbol, Prc, Ret, Shr, Numtrd, Vol, Facpr, Cap, Caldt
...
...
The first two variables are numeric, then I have the CUSIP number, which has both, numbers and letters in it, then the SIC code, then the ticker, another version of the ticker, the rest is numeric. The text fields don't have quotation marks around them.
Previously, my files were fixed and it was easy to break down the line into variables by specifying the position, lengh and using text functions. This one is space delimited and I'm having trouble reading it in.
When it reads that line, it takes the first two variables OK and assigns them. Then it takes the rest of the line and assigns it to NCUSIP (with spaces and all).
The rest gets messed up.
Thanks a lot in advance.
I know this is probably easy for some of ya.I'm trying to read in a large text file line by line, break it into variables and then do some filtering etc.
The file is space delimited. I do smth like this:
Open "c:\CrspVBA.txt" For Input As #1
Do While Not EOF(1)
'Read one line and then break it into variables
Input #1, PERMCO, PERMNO, NCUSIP, SICL, Ticker, Symbol, Prc, Ret, Shr, Numtrd, Vol, Facpr, Cap, Caldt
...
...
The first two variables are numeric, then I have the CUSIP number, which has both, numbers and letters in it, then the SIC code, then the ticker, another version of the ticker, the rest is numeric. The text fields don't have quotation marks around them.
Previously, my files were fixed and it was easy to break down the line into variables by specifying the position, lengh and using text functions. This one is space delimited and I'm having trouble reading it in.
When it reads that line, it takes the first two variables OK and assigns them. Then it takes the rest of the line and assigns it to NCUSIP (with spaces and all).
The rest gets messed up.
Thanks a lot in advance.