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.
Manipulating Dos dir output
Moderators: AmigoJack, bbadmin, helios, MudGuard
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
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
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.