tags:

views:

360

answers:

1

I have thousands of small CSV files I want to aggregate (with a little munging in-script first). They are on a NAS device, a "SNAP" Server to be more exact. I've had some success with VBA from Excel - doing about 700 files in about a minute, if I recall (was a month ago). Actually, it was half-success: the snap server is home to 80% pdfs and some proprietary-format files and only 20% CSVs. The Loop to test for filetype took the execution time north of 2 hours and the script apparently completely ignored date filtering I put in. The quick result or 'success' was on 700 copies of the CSVs I made and put on my C drive. I've been doing VBA scripting for almost 20 years, and I think I'm decent at it; I do a lot of CSV reading and writing from VBA the last 9 years. So my question is more about your experience with snap servers or NAS generally.

Can I not treat the snap server more or less like any drive/folder with VBA?
Would VBScript be more appropriate? (already using FileSystemObject, after all)
If I can use VBS can I store the script on the NAS and run it using taskscheduler? I'd appreciate any tips or gotchas from you folks who have experience with snap servers!

+1  A: 

Some thoughts on the choice of language:

VB Script is more lightweight than VBA in that it does not require MS Office to be installed. The syntax is similar so there is no real productivity difference.

Moving forward Powershell would be strongly recommended for Windows system admin tasks, general text file processing, etc.

Some thoughts on using the NAS server:

a) If running your script on a workstation you should be able to use a URI string \\myserver\myshare to connect to a share on the NAS. If not you may need to map a drive letter to that share before your script runs.

b) If you want to run your script on the NAS there are 2 things to consider: is the NAS OS locked so that you may not add your own scheduled task and is it Linux or some flavor of Windows. Many NAS products use embedded Linux so running a VBA or VBScript solution directly on the NAS may not work unless it is based on something like Embedded XP and you have access to Scheduled Tasks, etc.

Hope this helps...

Sam Russo
Thanks Sam! I will find out the Locking situation and I'll bet it is a Linux OS. May get my feet wet with Awk or Sed! I've been eyeballing Powershell, but I don't do Sysadmin stuff. I'm still considering it though. I'll search threads for PS vs. C# for using .NET for small projects. Thanks again
klausnrooster
Tried to vote you up, don't have the rep yet.
klausnrooster
Powershell is good for system admin tasks on Windows and has full access to .NET objects, WMI and other goodies. It would not compete with C# for software development.
Sam Russo
On the Linux side I think you could consider Perl which is great for working with text files. There may be other good alternatives but I'm not up on the latest hot scripting tools in Linux.
Sam Russo