Click here to Skip to main content
15,915,324 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a file directory named
\ArchView\03_Reports\2016\10\8lotname\lotname


How do I extract data from that file directory and put it into the form that I created on Microsoft Visual Studio?

For example, I want to extract the
TEST-BEG : 2017-01-06 08:37
into my program.

Thank you in advance

What I have tried:

Some codes that I have tried:

DirectoryInfo di = new DirectoryInfo(strDirectory);

                try
                {
                    var myFile = (from f in di.GetFiles(searchLotName)
                                  orderby f.LastWriteTime descending
                                  select f).First();
                    row[ISSELECTED] = true;
                    row[TLTPATH] = myFile.FullName;
                    row[TESTDIRPATH] = string.Format(@"\\{0}\{1}", FAR_Yield_Analysis_Test_Tool.Properties.Settings.Default.TestDirPartialPath);
                    row[TIMESTAMP] = myFile.FullName;

                    GetTestModeandTimeStamp(myFile.FullName, ref strTestMode, ref strTimeStamp, ref strProgram);

                    row[searchLotName] = strLotName; 
                    row[TESTMODE] = strTestMode;
                    row[PROGRAM] = strProgram;
                    row[TIMESTAMP] = strTimeStamp;
                    row[TESTDIRPATH] = string.Format(@"\\{0}\{1}", FAR_Yield_Analysis_Test_Tool.Properties.Settings.Default.TestDirPartialPath);
<pre lang="c#">
Posted
Comments
Ziee-M 2-Feb-18 10:49am    
https://www.dotnetperls.com/streamreader
Maciej Los 4-Feb-18 11:19am    
"I want to extract the TEST-BEG : 2017-01-06 08:37 into my program."
Extract from folder name or file name or a content of file?
Member 13650651 4-Feb-18 19:56pm    
extract from a content of file
Maciej Los 5-Feb-18 1:37am    
And the content of your file is...
Please, use Improve question[^] widget to update your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900