Manipulating Dos dir output

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
User avatar
ChugALug
Posts: 2
Joined: Fri Jun 27, 2008 3:33 pm

Manipulating Dos dir output

Post by ChugALug »

Hello. I'm attempting to manage some dos dir outputs to go from this (sample) output:

C:\my dir\folder 1
File 1.txt 1,674,350 03/03/2006 3:15pm
File 2.txt 1,674,350 03/03/2006 3:15pm
File 4.txt 1,674,350 03/03/2006 3:15pm

3 files; 4,000,000 bytes

C:\my dir\folder 2
File 5.txt 1,674,350 03/03/2006 3:15pm
File 6.txt 1,674,350 03/03/2006 3:15pm

2 files; 4,000,000 bytes

To this output:

C:\my dir\folder 1 File 1.txt 1,674,350 03/03/2006 3:15pm
C:\my dir\folder 1 File 2.txt 1,674,350 03/03/2006 3:15pm
C:\my dir\folder 1 File 4.txt 1,674,350 03/03/2006 3:15pm

3 files; 4,000,000 bytes

C:\my dir\folder 2 File 5.txt 1,674,350 03/03/2006 3:15pm
C:\my dir\folder 2 File 6.txt 1,674,350 03/03/2006 3:15pm

2 files; 4,000,000 bytes

My attempt at a macro was to record macro1 which would just do a past and move to next line, and process on selection.

I then recorded macro2 which would find c:\my dir, go to end of line insert a tab, and copy whole line, and go to next line. I then searched for the next c:\my dir and extended selection and ran marco1.

When I do this while recording the macro it works. As soon as I run macro2 on its own nothing goes as it should.

Any help or suggestions would be appreciated.
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

I don't have the time to mess with the regular expression. I suspect you'll run into issues with the fact that there will be line breaks.

As an alternative suggestion, do you need the file info? Would getting the fully qualified name of the files work for you? If so, try dir /b /s It will dump the following information.

C:\my dir\folder 1\File 1.txt
C:\my dir\folder 1\File 2.txt
C:\my dir\folder 1\File 4.txt
C:\my dir\folder 2\File 5.txt
C:\my dir\folder 2\File 6.txt
I choose to fight with a sack of angry cats.
User avatar
ChugALug
Posts: 2
Joined: Fri Jun 27, 2008 3:33 pm

Post by ChugALug »

Thanks for the input... I figured a way but had to use xls to get it complete.
Post Reply