Hi Noorain, The following are two examples of the text files that would be encountered. I have only shown the first and last 4 rows of the files. The over all length of the files is very variable but hold to the same format. Some files may end in *.out, *.txt or just *.. The files should all begin and end with the percent sign. There may be blank rows between data rows. Is this what you ask?
1st file "3007.out" % N0010 O3007 (UNDERSIDE OF REMOTE COVER) N0020 G0 G17 G40 G80 G90 H0 E0 N0030 M6 T1 (0.750 DIA - END MILL) N0040 M3 S650 ......... N2290 E0 H0 X0 Y0 Z0 N2300 G53 X0 Y9.75 N2310 M0 N2320 M2 % 2nd file "8228." % N1O8228(790 SMART CHUCK CAMDEN) N2M6T1 N3M3S1200 N4G0G90 ......... N73E0H0X0Y0Z0 N74G53Y9.75 N75M0 N76M2 % The desired output would be like: File ID Comment 3007.out 3007 UNDERSIDE OF REMOTE COVER 8228. 8228 790 SMART CHUCK CAMDEN The ID is always after the letter O. The comment is always between the perentheses. Thanks for looking at it. John On Sep 15, 12:52 pm, NOORAIN ANSARI <noorain.ans...@gmail.com> wrote: > Dear John, > > Please share sample sheet with us > > > > > > On Thu, Sep 15, 2011 at 9:39 PM, johnofeasttex <j...@demco-mfg.com> wrote: > > Hello, > > I need to look in individual directories of text files and create a > > list in Excel showing all files in that directory in one column with > > data from the first row starting with the letter "N" parsed into the > > adjacent 2 columns. The data will be of various lengths but the format > > will look like "N1O8214(CUT RH MAG4)". There may oy may not be spaces > > in this row. The first column would be the file name, the second > > column would be the "O" word from the first "N" row, in this case > > "8214". The third row would be the comment in the brakets, in this > > case "CUT RH MAG4". I have some experience with macros and basic > > programming but have very little experience with file data extracting > > and parsing. > > > Thanks > > > -- > > > ---------------------------------------------------------------------------------- > > Some important links for excel users: > > 1. Follow us on TWITTER for tips tricks and links : > >http://twitter.com/exceldailytip > > 2. Join our LinkedIN group @http://www.linkedin.com/groups?gid=1871310 > > 3. Excel tutorials athttp://www.excel-macros.blogspot.com > > 4. Learn VBA Macros athttp://www.quickvba.blogspot.com > > 5. Excel Tips and Tricks athttp://exceldailytip.blogspot.com > > > To post to this group, send email to excel-macros@googlegroups.com > > > <><><><><><><><><><><><><><><><><><><><><><> > > Like our page on facebook , Just follow below link > >http://www.facebook.com/discussexcel > > -- > Thanks & regards, > Noorain Ansari > *http://excelmacroworld.blogspot.com/*<http://excelmacroworld.blogspot.com/> > *http://noorain-ansari.blogspot.com/*<http://noorain-ansari.blogspot.com/>- > Hide quoted text - > > - Show quoted text - -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel