Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Processing Question
#1
I need to create 12,000 plus folders from a file I can create in Excel 2016 and export as text.

I need an app that can do the following automatically until I reach the end of the excel input file.

1. Read record from Excel 2016 input file.
2. Go to D drive, make new directory, no security.
3. Go back to excel read next record, make new directory.
4. Go back to number 1 above until end of file reached.
5. No vb, c or any other coding required.

Will this app do this by recording, mouse and keyboard entries.

Thanks, Jake
#2
Could you post a sample of your excel file?
#3
With recording keys/mouse maybe possible but will be very slow for 12000.

With coding:
Macro Macro2746
Code:
Copy      Help
;This macro takes the selected range from Excel (can be whole column selected or just part),
;and creates folders using names from the selected cells.

str where="D:\Test" ;;change this
ExcelSheet e.Init
ARRAY(str) a; int i
e.CellsToArray(a "sel")
for i 0 a.len
,str path=F"{where}\{a[0 i]}"
,out path
,;mkdir path ;;uncomment this when this macro is ready to create folders
#4
the site will not allow the file type to be uploaded.
I copied 3 records below, lrecl is fixed, but I need the new directory to contain alphanumeric within the directory name and all trailing blanks/ spaces to be removed.

Tom Jacobs - Amnin
Mary Walkley Room 432
Tom Donvan
#5
Macro Macro16
Code:
Copy      Help
;Supposed you have all the records contains in a text file called "records.txt"
;and it is on the desktop. You could change the location later.
;The directory on D drive is "Test", you could change it later, too.
;Then run this macro.
out
ARRAY(str) a
str folders.getfile("$desktop$\records.txt")
folders.findreplace(" " "" 8)
a=folders
str where="D:\Test" ;;change this
for int'i 0 a.len
,a[i].ReplaceInvalidFilenameCharacters("")
,;out a[i]
,mkdir a[i] where
,
out "All Done!"
#6
Thank you, can't believe the world class service.

Last questions

1. how do I execute the code, save filename and run
2. what would file type be, Mkdir.?
3. anything else, if not, then I will test and let you know results

thanks
#7
I assume you know how to compile a macro into an exe, don't you?
If not here are some typical steps:
1/ Click on "Run" in the menubar of Quick Macros tool.
2/ Select "Make Exe..."
3/ In the "Make Exe..." popup dialog that comes up, just change "Make" field to where you want the executable to be created. By default it will creates the executable file in "C:\Users\Documents\My QM" folder.
4/ Then just click "OK" button.
5/ If all goes well you will see the following line in the QM output window:
Created "<Macro_Name>.exe", nnn KB.
The executable name is the name of the macro itself with the extension of exe.
Once you have the exe file you could copy/move it to whatever folder/drive you want and run it to execute it.


Forum Jump:


Users browsing this thread: 1 Guest(s)