Solved

VFP9 CSV Parse Against Cursor Values

Posted on 2010-11-11
3
418 Views
Last Modified: 2012-06-22
Hi all. I have a csv file which contains about 18,000 lines (records), 30 fields in each.

I also have a cursor with names of states, 'Alabama', 'Alaska', 'Arizona', etc.
Not all states are in the cursor.

What I need to do is process the csv file so that any records in the csv containing a state that is not in the cursor are removed, and speed is important.

The format of the csv is:

"Arthur","Florida", (+28 more fields)
"Phillips","Alaska", (+28 more fields)

I'm assuming CHR(13) + CHR(10) for line feed.

Thanks!
0
Comment
Question by:formadmirer
[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
  • 3
3 Comments
 

Author Comment

by:formadmirer
ID: 34117202
I've taken the csv and used FILETOSTR to further process it. Which works fine as long as I'm not trying to look for the state value from the CURSOR.

The question marks are where I'm stuck.


CRLF = CHR(13) + CHR(10)

cCSV = FILETOSTR(cMy_CSV)
cCSV = cCSV + CRLF

DO WHILE CRLF $ cCSV AND ????


0
 

Author Comment

by:formadmirer
ID: 34117353
If someone can answer this one question, I've got the rest.

Once the csv file has been parsed using FILETOSTRING, how do I determine the value of the second field of each record?
0
 

Accepted Solution

by:
formadmirer earned 0 total points
ID: 34117661
Nevermind, I got it.

Use AT to look at first and second occurrence of ","

Calculated difference, used a SUBSTRs followed by STRTRAN to retrieve the necessary data for comparison.
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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