Extracting Data


I have a huge .txt file with many lines of code. Within the code there is a specific word I want the whole line for, if that word is not on in that line then I don't want to see it. The word may in in different places so its not always on the same COL. Is there a .bat file I can create or a way to do this in access?  Any time FNDIARY is in my .txt file I want that whole line.

Thank you.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITEnd-user supportCommented:
Run this on the CMD prompt:
find "FNDIARY" hugefile.txt

Open in new window

If you want to know the line numbers they are on:
find /n "FNDIARY" hugefile.txt

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WO2015Author Commented:
How do I run that when the file is on my desktop?
NVITEnd-user supportCommented:
> How do I run that when the file is on my desktop?
find /n "FNDIARY" "%userprofile%\desktop\hugefile.txt"

Open in new window

Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

WO2015Author Commented:
Thank you, that exports them all in the command window but how do I get it in a .txt format?
Matt KmetyEnterprise Application AdministratorCommented:
you could also run
findstr "FNDIARY" filename.txt

Open in new window

from the command line which is essentially the same as the other answers.
NVITEnd-user supportCommented:
find /n "FNDIARY" "%userprofile%\desktop\hugefile.txt" > "%userprofile%\desktop\find_results.txt"
Matt KmetyEnterprise Application AdministratorCommented:
You can pipe the output to a text file.

findstr "FNDIARY" filename.txt > C:\filename2.txt

Open in new window

WO2015Author Commented:
Perfect, thank you!
NVITEnd-user supportCommented:

1. ID: 40860512 doesn't answer your question ID: 40860493, which ID: 40860497 does.

2. ID: 40860510 answers your question ID: 40860503, and comes before ID: 40860512

WO2015Author Commented:
NVITEnd-user supportCommented:

My apologies for the last reaction post. I felt points were unfairly assigned. Would you please consider re-assigning the points based on the ID answers I mentioned? You  can ask an administrator to re-open the topic by picking the Request for Attention link at the top. Then enter your request.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.