Extracting Data

Hello,

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.
WO2015Asked:
Who is Participating?
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.

NVITCommented:
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

0

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?
0
NVITCommented:
> How do I run that when the file is on my desktop?
find /n "FNDIARY" "%userprofile%\desktop\hugefile.txt"

Open in new window

0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

WO2015Author Commented:
Thank you, that exports them all in the command window but how do I get it in a .txt format?
0
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.
0
NVITCommented:
find /n "FNDIARY" "%userprofile%\desktop\hugefile.txt" > "%userprofile%\desktop\find_results.txt"
0
Matt KmetyEnterprise Application AdministratorCommented:
You can pipe the output to a text file.

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

Open in new window

0
WO2015Author Commented:
Perfect, thank you!
0
NVITCommented:
Hmm...

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

Whatever.
0
WO2015Author Commented:
huh?
0
NVITCommented:
WO2015,

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.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.