We help IT Professionals succeed at work.
Get Started

How do I search a specific space in a text file for specific data

Stephen Roesner
Last Modified: 2015-03-10
I use the following code to open a super large text file
so I can rewrite it to a smaller size for import.
This code works great.

Now I have another even larger text file that I need data from
I have determined that if I can say something like
(only grab the records where col 92-93-94-95 = 2014)
and write it to file 2 then I can narrow it down to the records I need
is this possible?

 'this converts the large file to an Access importable file
    Open "C:\ERPDP\NationsIn\LISLEPD\EFTOFS5617MONMEMDD150201T1620042.txt" For Input As #1
    Open "C:\ERPDP\MONMEMD.txt" For Output As #2
    Do Until EOF(1)
        Line Input #1, str
        If str & "" <> "" Then _
        Print #2, Left(str, 406)
Watch Question
Distinguished Expert 2017
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE