Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

parse data from csv file to webpage

Posted on 2014-03-12
3
Medium Priority
?
507 Views
Last Modified: 2014-03-12
I have a csv file that has 7 columns and 1974 rows. this csv file is automatically put in the folder every 5 minutes and the old one is just overwritten. I have no way of making this a template file so what i need to do is get this data into something that will allow me to pull data out of it and post to a webpage metric table. column A is the column that had the "name" i would be looking for to decide what data I am wanting to post. The webpage would be an ASP page and I am familier with using vbscripting code and pulling data that way. I have attached a sample of how the CSV file is formatted.
testWeb.csv
0
Comment
Question by:jlcannon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 54

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 2000 total points
ID: 39923753
Try this

<%
Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\inetpub\wwwroot\folder\testWeb.csv", ForReading)
response.write "<table>"
Do Until objFile.AtEndOfStream
    strLine = objFile.ReadLine
    arrFields = Split(strLine, ",")
    
	response.write "<tr><td>"&arrFields(0)& "</td><td>"&arrFields(1)&"</td><td>"&arrFields(2)&"</td><td>"&arrFields(3)&"</td></tr>"
 
Loop

objFile.Close
%>

Open in new window

0
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39923758
If you need to filter the first column of what I posted, you could do

<%
Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\inetpub\wwwroot\folder\testWeb.csv", ForReading)
response.write "<table>"
Do Until objFile.AtEndOfStream
    strLine = objFile.ReadLine
    arrFields = Split(strLine, ",")
    
    if arrFields(0)="Greek" then
	response.write "<tr><td>"&arrFields(0)& "</td><td>"&arrFields(1)&"</td><td>"&arrFields(2)&"</td><td>"&arrFields(3)&"</td></tr>"
 end if
Loop

objFile.Close
%>

Open in new window

0
 

Author Closing Comment

by:jlcannon
ID: 39923878
Thank you this will help get me on my way. Still have hurdles with this data but this is exactly the start I needed.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question