Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Read a CSV File

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,26532
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Read a CSV File
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Read a CSV File - 9/28/2005 11:42:44 PM   
  anuccite

 

Posts: 4
Score: 0
Joined: 8/17/2001
From:
Status: offline
Hi,

I am looking to Extract one column from a row with VBScript

My CSV file would look like this,

<MachineName>, <Username>, <datescanned>, <size>, <location>
<MachineName>, <Username>, <datescanned>, <size>, <location>

I would like to be able to extract just the <datescanned> for a <machinename> I request

I am sure it's a Readline command using some instr or Mid,  But I can put my hands around it

Thanks in advance



 
 
Post #: 1
 
 RE: Read a CSV File - 9/29/2005 12:14:56 AM   
  sethsdad


Posts: 115
Score: 0
Joined: 4/4/2005
From: USA
Status: offline
you would use readline to load the line into memory.
you would use instr to locate the start of the field after the second comma.

you can do searches here and find examples of both of these.
good luck.

(in reply to anuccite)
 
 
Post #: 2
 
 RE: Read a CSV File - 9/29/2005 6:03:47 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
like sethsdad mentioned, you'd have to open the file and readline through it, but the easiest way to parse out csv is using the split function.

reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctsplit.asp

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to sethsdad)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Read a CSV File Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts