Manipulating Dos dir output
Posted: Fri Jun 27, 2008 4:10 pm
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.
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.