Greetings,
Can anyone point me to some software that will extract data from multiple text files?
What I have are multiple text files (.txt) and each one has some data in the same location. This data consists of text plus a number IE. "Passed 36"
All the text files will have this text and number (the number will vary) in the same location, as in the same line.
Ultimately, I want to sum all the parts that "passed" to get a grand total. My test equipment generates a text file after every test run, and includes the number of parts that passed.
I'm just wondering if there is software available to work with these multiple (maybe thousands) of text files, and get the number from a specific line, and sum it up (if I can just get all the numbers, I can use a spreadsheet to get the sum).
As always, any guidance is greatly appreciated.
Sincerely,
Mike Hansen
[SOLVED] software to extract data from multiple text files
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
-
- Level 3
- Posts: 161
- Joined: Sat Oct 25, 2008 12:51 am
[SOLVED] software to extract data from multiple text files
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: software to extract data from multiple text files
Hi,
Frankly said, this looks like a solution for a script (non-GUI software) ...
Are you OK with that?
Regards,
Frankly said, this looks like a solution for a script (non-GUI software) ...
Are you OK with that?
Regards,
Re: software to extract data from multiple text files
It should be easy to accomplish in any of the supported programming languages.
I can help in php, but that means that you will need to have an active LAMP server up and running first. Probably more effort than it's worth.
Stay tuned as someone versed in python, c++ or bash using a regular statement may chime in for an easier solution.
-DataMan
I can help in php, but that means that you will need to have an active LAMP server up and running first. Probably more effort than it's worth.
Stay tuned as someone versed in python, c++ or bash using a regular statement may chime in for an easier solution.
-DataMan
Re: software to extract data from multiple text files
grep seems to be what you are looking for.
Open a terminal, navigate to the folder with all your text files and
You can pass the output into another file like this:
Your output.txt will contain all lines from the source files which include the word "Passed". It doesn't need to know which line "Passed" appears in.
Open a terminal, navigate to the folder with all your text files and
Code: Select all
grep Passed *.txt
Code: Select all
grep Passed *.txt > output.txt
-
- Level 3
- Posts: 161
- Joined: Sat Oct 25, 2008 12:51 am
Re: software to extract data from multiple text files
Thanks everyone. I will look at the grep option. I'm at work right now, running Windows. Will need to bring my laptop in to try this.
Answer to one of the questions: I don't mind if it is not a GUI program, but I may need guidance to get started. I have some limited programming experience with VB.NET, and also I use VBA here at work (Excel).
I will comment again if the grep option works for me.
Mike
Answer to one of the questions: I don't mind if it is not a GUI program, but I may need guidance to get started. I have some limited programming experience with VB.NET, and also I use VBA here at work (Excel).
I will comment again if the grep option works for me.
Mike
-
- Level 3
- Posts: 161
- Joined: Sat Oct 25, 2008 12:51 am
[SOLVED] Re: software to extract data from multiple text fil
The suggestion to use "grep" worked great. Problem solved. I have what I need.
Thanks,
Mike
Thanks,
Mike