Mike
asked on
Need a PowerShell/VBS script to Count No# of rows in Mutiple Excel spreadsheets
Hello Experts,
I am looking for a script that can count the number of rows being used in folder full of excel documents ( 40-60 spreadsheets). I need the script to produce a output.csv file with the name of the file and the no# of rows being used. Does anybody have Powershell or VB script that can handle this task.......
example
Name of File Number of Rows Used
File name No# of Rows used
File name No# of Rows used
File name No# of Rows used
I am looking for a script that can count the number of rows being used in folder full of excel documents ( 40-60 spreadsheets). I need the script to produce a output.csv file with the name of the file and the no# of rows being used. Does anybody have Powershell or VB script that can handle this task.......
example
Name of File Number of Rows Used
File name No# of Rows used
File name No# of Rows used
File name No# of Rows used
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Subsun, your powershell script perfect ... The output is what I am looking for thank you for your help.....
Amstoots,
Did you happen to see my response as well?
DH
Did you happen to see my response as well?
DH
ASKER
yes I did DaleHarris , sorry I didn't respond to yours.... Subsun Powershell script was more streamlined and and was able to use Export-CSV to output the Resolute. I did attempt to use your but ran in few problems... thank you for your time you have put in this.......
Okay no problem. Glad you got it solved quickly.
ASKER
I have one more question on this script guys...... How can you tell the script to look for a pacific name in a list of spreadsheets.... For example, I need to look for number of spreadsheet that have the following file name "Local Administrator Access by All Servers MM-DD-YYYY.xls". I would like to add to the script to only search for those files in the folder with the file name "Local Administrator Access by All Servers MM-DD-YYYY.xls" and use a wild card "*" for the date (i.e. Local Administrator Access by All Servers *.xls.) Would this be possible.....?
Yes you can do that..
Get-Childitem -Include "Local *.xls","Local *.xlsx" -Recurse
ASKER
Perfect, thanks for the additional Help.... Subsun ..... :)
You are welcome!!
Hi,
Thank you subsun for posting this.. It worked accurately on most files but its is displaying the wrong number for a couple of them. Any idea as to why?
Thank you subsun for posting this.. It worked accurately on most files but its is displaying the wrong number for a couple of them. Any idea as to why?
http://blogs.technet.com/b/heyscriptingguy/archive/2010/04/05/hey-scripting-guy-april-5-2010.aspx
Open in new window
Note: it doesn't create a CSV but you can easily export into CSV in the script, or like I prefer: importing into an excel, separated by semicolon. Just open the excel, click on the Data Tab, click on From Text, and just follow the wizard.
Regards,
DH