Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
I need a way to run a command in the CMD window and retrieve the output back
into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
redirect the output into a file and open the file.
-- Regards, Tom Ogilvy "Kevin" wrote: I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
I think it's less work if you just send your output to a file. So 'C:\dir' gives a directory, but to flush the directory contents into a text file, use: C:\dir C:\dir.txt Once you have the text file, it's quite easy to open that with Excel. "Kevin" schreef in bericht ... I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
Unfortunatley that wont work for me, the CMD shell Im using is a striped down
version for a storage array and I cannot change directories or direct to a file. It is a CMD window that is interating with the storage array and the commands are VERY limited. the only way I can get the data into excel now is to select the text and paste it. The only traditional CMD functions I have on it are to right click the title bar and choose Mark,Copy, Paste, Select all, Scroll and Find. "moon" wrote: I think it's less work if you just send your output to a file. So 'C:\dir' gives a directory, but to flush the directory contents into a text file, use: C:\dir C:\dir.txt Once you have the text file, it's quite easy to open that with Excel. "Kevin" schreef in bericht ... I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
Try using SendKeys (the API version is more robust than the Excel
implementation) to send a Select All / Copy. Then you can read the clipboard and parse in Excel. Not the best solution but it should work. Regards, Bill "Kevin" wrote: Unfortunatley that wont work for me, the CMD shell Im using is a striped down version for a storage array and I cannot change directories or direct to a file. It is a CMD window that is interating with the storage array and the commands are VERY limited. the only way I can get the data into excel now is to select the text and paste it. The only traditional CMD functions I have on it are to right click the title bar and choose Mark,Copy, Paste, Select all, Scroll and Find. "moon" wrote: I think it's less work if you just send your output to a file. So 'C:\dir' gives a directory, but to flush the directory contents into a text file, use: C:\dir C:\dir.txt Once you have the text file, it's quite easy to open that with Excel. "Kevin" schreef in bericht ... I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
I dont think its going to work for me, the CMD app that Im running doest even
have a way to select and copy with the keyboard. I cant even hit Alt to get a drop down menu. The only way to get hte options to come up is to right click the title bar. This is a lousy interface..... Is there a sendkey command for mouse functions?? Unfortunatly I dont know anything about using the API, and dont know if that will work either. "Bill Pfister" wrote: Try using SendKeys (the API version is more robust than the Excel implementation) to send a Select All / Copy. Then you can read the clipboard and parse in Excel. Not the best solution but it should work. Regards, Bill "Kevin" wrote: Unfortunatley that wont work for me, the CMD shell Im using is a striped down version for a storage array and I cannot change directories or direct to a file. It is a CMD window that is interating with the storage array and the commands are VERY limited. the only way I can get the data into excel now is to select the text and paste it. The only traditional CMD functions I have on it are to right click the title bar and choose Mark,Copy, Paste, Select all, Scroll and Find. "moon" wrote: I think it's less work if you just send your output to a file. So 'C:\dir' gives a directory, but to flush the directory contents into a text file, use: C:\dir C:\dir.txt Once you have the text file, it's quite easy to open that with Excel. "Kevin" schreef in bericht ... I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
Is there a sendkey command for mouse functions??
Yes - you can essentially emulate anything you do with an input device from an API call. I usually use http://www.allapi.net for reference. One approach is to 1) find the windows handle for your CMD box (use "FindWindows" API call) 2) find the location of the window title (I don't recall the api function) 3) use "mouse_event" to simulate a mouse right-click on the title bar 4) use the "sendkeys" to move around on your context/right-click menu and press enter for confirming your menu selection Unfortunately, I don't have any examples on handle, but allapi should get you headed in the right direction. "Kevin" wrote: I dont think its going to work for me, the CMD app that Im running doest even have a way to select and copy with the keyboard. I cant even hit Alt to get a drop down menu. The only way to get hte options to come up is to right click the title bar. This is a lousy interface..... Is there a sendkey command for mouse functions?? Unfortunatly I dont know anything about using the API, and dont know if that will work either. "Bill Pfister" wrote: Try using SendKeys (the API version is more robust than the Excel implementation) to send a Select All / Copy. Then you can read the clipboard and parse in Excel. Not the best solution but it should work. Regards, Bill "Kevin" wrote: Unfortunatley that wont work for me, the CMD shell Im using is a striped down version for a storage array and I cannot change directories or direct to a file. It is a CMD window that is interating with the storage array and the commands are VERY limited. the only way I can get the data into excel now is to select the text and paste it. The only traditional CMD functions I have on it are to right click the title bar and choose Mark,Copy, Paste, Select all, Scroll and Find. "moon" wrote: I think it's less work if you just send your output to a file. So 'C:\dir' gives a directory, but to flush the directory contents into a text file, use: C:\dir C:\dir.txt Once you have the text file, it's quite easy to open that with Excel. "Kevin" schreef in bericht ... I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
Thanks for the link, I will have to do some reading....
"Bill Pfister" wrote: Is there a sendkey command for mouse functions?? Yes - you can essentially emulate anything you do with an input device from an API call. I usually use http://www.allapi.net for reference. One approach is to 1) find the windows handle for your CMD box (use "FindWindows" API call) 2) find the location of the window title (I don't recall the api function) 3) use "mouse_event" to simulate a mouse right-click on the title bar 4) use the "sendkeys" to move around on your context/right-click menu and press enter for confirming your menu selection Unfortunately, I don't have any examples on handle, but allapi should get you headed in the right direction. "Kevin" wrote: I dont think its going to work for me, the CMD app that Im running doest even have a way to select and copy with the keyboard. I cant even hit Alt to get a drop down menu. The only way to get hte options to come up is to right click the title bar. This is a lousy interface..... Is there a sendkey command for mouse functions?? Unfortunatly I dont know anything about using the API, and dont know if that will work either. "Bill Pfister" wrote: Try using SendKeys (the API version is more robust than the Excel implementation) to send a Select All / Copy. Then you can read the clipboard and parse in Excel. Not the best solution but it should work. Regards, Bill "Kevin" wrote: Unfortunatley that wont work for me, the CMD shell Im using is a striped down version for a storage array and I cannot change directories or direct to a file. It is a CMD window that is interating with the storage array and the commands are VERY limited. the only way I can get the data into excel now is to select the text and paste it. The only traditional CMD functions I have on it are to right click the title bar and choose Mark,Copy, Paste, Select all, Scroll and Find. "moon" wrote: I think it's less work if you just send your output to a file. So 'C:\dir' gives a directory, but to flush the directory contents into a text file, use: C:\dir C:\dir.txt Once you have the text file, it's quite easy to open that with Excel. "Kevin" schreef in bericht ... I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
Kevin, since you don't have any API exposure, I cobbled together an example
to get you started. The majority of the source comes from examples found on AllAPI.net (original authors and Daniel Kaufmann )). Download the file (http://wcpii.com/Documents/modCaptureCmd.bas_) and rename the extension to ".bas". Add the module to a workbook and start with the "CaptureFromNotepad" sub. "Kevin" wrote: Thanks for the link, I will have to do some reading.... "Bill Pfister" wrote: Is there a sendkey command for mouse functions?? Yes - you can essentially emulate anything you do with an input device from an API call. I usually use http://www.allapi.net for reference. One approach is to 1) find the windows handle for your CMD box (use "FindWindows" API call) 2) find the location of the window title (I don't recall the api function) 3) use "mouse_event" to simulate a mouse right-click on the title bar 4) use the "sendkeys" to move around on your context/right-click menu and press enter for confirming your menu selection Unfortunately, I don't have any examples on handle, but allapi should get you headed in the right direction. "Kevin" wrote: I dont think its going to work for me, the CMD app that Im running doest even have a way to select and copy with the keyboard. I cant even hit Alt to get a drop down menu. The only way to get hte options to come up is to right click the title bar. This is a lousy interface..... Is there a sendkey command for mouse functions?? Unfortunatly I dont know anything about using the API, and dont know if that will work either. "Bill Pfister" wrote: Try using SendKeys (the API version is more robust than the Excel implementation) to send a Select All / Copy. Then you can read the clipboard and parse in Excel. Not the best solution but it should work. Regards, Bill "Kevin" wrote: Unfortunatley that wont work for me, the CMD shell Im using is a striped down version for a storage array and I cannot change directories or direct to a file. It is a CMD window that is interating with the storage array and the commands are VERY limited. the only way I can get the data into excel now is to select the text and paste it. The only traditional CMD functions I have on it are to right click the title bar and choose Mark,Copy, Paste, Select all, Scroll and Find. "moon" wrote: I think it's less work if you just send your output to a file. So 'C:\dir' gives a directory, but to flush the directory contents into a text file, use: C:\dir C:\dir.txt Once you have the text file, it's quite easy to open that with Excel. "Kevin" schreef in bericht ... I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get data from CMD line
Thats way cool of you Bill !!!
I have it installed and it works great with the notepad. I'm playing around with the names in the CaptureFromNotepad sub to use the app Im trying to get info from. no luck yet, but I'm looking.... Thanks, Kevin "Bill Pfister" wrote: Kevin, since you don't have any API exposure, I cobbled together an example to get you started. The majority of the source comes from examples found on AllAPI.net (original authors and Daniel Kaufmann )). Download the file (http://wcpii.com/Documents/modCaptureCmd.bas_) and rename the extension to ".bas". Add the module to a workbook and start with the "CaptureFromNotepad" sub. "Kevin" wrote: Thanks for the link, I will have to do some reading.... "Bill Pfister" wrote: Is there a sendkey command for mouse functions?? Yes - you can essentially emulate anything you do with an input device from an API call. I usually use http://www.allapi.net for reference. One approach is to 1) find the windows handle for your CMD box (use "FindWindows" API call) 2) find the location of the window title (I don't recall the api function) 3) use "mouse_event" to simulate a mouse right-click on the title bar 4) use the "sendkeys" to move around on your context/right-click menu and press enter for confirming your menu selection Unfortunately, I don't have any examples on handle, but allapi should get you headed in the right direction. "Kevin" wrote: I dont think its going to work for me, the CMD app that Im running doest even have a way to select and copy with the keyboard. I cant even hit Alt to get a drop down menu. The only way to get hte options to come up is to right click the title bar. This is a lousy interface..... Is there a sendkey command for mouse functions?? Unfortunatly I dont know anything about using the API, and dont know if that will work either. "Bill Pfister" wrote: Try using SendKeys (the API version is more robust than the Excel implementation) to send a Select All / Copy. Then you can read the clipboard and parse in Excel. Not the best solution but it should work. Regards, Bill "Kevin" wrote: Unfortunatley that wont work for me, the CMD shell Im using is a striped down version for a storage array and I cannot change directories or direct to a file. It is a CMD window that is interating with the storage array and the commands are VERY limited. the only way I can get the data into excel now is to select the text and paste it. The only traditional CMD functions I have on it are to right click the title bar and choose Mark,Copy, Paste, Select all, Scroll and Find. "moon" wrote: I think it's less work if you just send your output to a file. So 'C:\dir' gives a directory, but to flush the directory contents into a text file, use: C:\dir C:\dir.txt Once you have the text file, it's quite easy to open that with Excel. "Kevin" schreef in bericht ... I need a way to run a command in the CMD window and retrieve the output back into Excel. Is there a way to do this? For example if my output below is in the CMD window I want to capture the Items starting with DEVA. ------------------------------------------------ Systems available on this Manager: DEVA01-0BF0 DEVA02-0290 DEVA03-0CD0 NoSystemSelected ------------------------------------------------ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Moving a line chart data point revises data table value in Excel ' | Charts and Charting in Excel | |||
How do I set a Trend Line and Remove the Data Line | Charts and Charting in Excel | |||
Cutting a line in a line chart when data series stops | Charts and Charting in Excel | |||
My rows are off by one row, ie. data on line 10 should line up wi. | New Users to Excel | |||
Macro problem on, Yellowed line - previous line or next line. | Excel Programming |