Solved

VFP9 CSV Parse Against Cursor Values

Posted on 2010-11-11
3
359 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now