Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use VBScript..?

Status
Not open for further replies.

Fherrera

Technical User
May 11, 2004
129
CA
Hi, i've come up with a problem that I hope VBscript may be the answer too. I've never created my own VBScript and am interested in finding out more... (beginner stuff first)

But, ATM I have 1.3 gigz worth of CSV text files that I need to convert the dates off...

Files are formatted as such::
TAG,DATE,VALUE
UNIT1_A5272019,6/29/1993 8:48 AM,3
...



I need to delete the AM's and if there is a PM i guess add 12 to the hour of the time... Ie. convert 12 hour to 24 hour.

I need to do this so when I import all these into Access it converts the dates properly...

Also, i'd like to create a new file not just overwrite the old ones as I'd like to keep them for backup purposes...

Is VBScript the proper tool to use? I'd like to do this in a relatively timely manner... I have 50 csv files raning from 200kb to 40Mb (mostly leaning toward 40mb)

Any help would be appreciated. (even just a couple of links to tutorials or intro's of getting started in VBScript)

As it stands I've done quite a bit of VBA programming in Excel for the last month so I'm a bit experienced in that and that will hopefully help me in this...

Thank you

Frank
 
Are you sure you'll need to convert the dates?

If Access imports these files, and the "date" field is an Access "date" type column instead of just text - it is simply a matter of how you format these for presentation within Access.

Internally Access date/time values are stored as a double-precision floating-point value anyway.

If you want these imported as text (and thus need them converted/reformatted) there are several options of course. You might try a keyword-search of this forum for CSV.
 
So it seems I'm trying to make things much more complicated for myself.

Indeed, one of the other forums suggested I use a CDate function to UPDATE the date column after importing it as text.

It worked great.

Still, my intriguie for VBScript remains :D
 
I'm trying to find some intro/beginner information for VBScript ... but all I find is stuff for Internet Explorer... I thought vbscript could be called from the OS..(kinda like running an executable)... Is this true? And if so, where can I get more information on that.. vs. using vbscript in html webpages... similar to javascript.

Thanks

Frank
 
The samples from windows 98 c:\windows\samples\wsh\*.vbs
are fun to "play with". They give you a small view of the power of vbscipt.


if it is to be it's up to me
 
It's been a long time since windows 98 for me. But i'll search for vbs's on NT here at work and XP at home. Thanks infinitelo.

I surfed quite a while through the scripting site and did learn quite a bit. Mostly about the windows script host (WSH) which seems to be one of the major objects. A tiny bit about the Excel object and some on the filecreationobject I believe it was called.

Also finally learned about DLLs from another source... So quite a productive day yesterday :D

Where there any other "major" objects one might want to learn about?

Thx
 
yes the big one for me was the file system object.
it gives you acess to the windows file system (drives
folders, network stuff)

i work with a lot of flat text at work and find
the string processing pretty good.

if it is to be it's up to me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top