?
Solved

VFP9 CSV Parse Against Cursor Values

Posted on 2010-11-11
3
Medium Priority
?
432 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

752 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