[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VFP9 CSV Parse Against Cursor Values

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
WooCommerce is becoming the most powerful e-commerce plugin for Wordpress. And why not. The platform comprises of numerous core plugins that may come in handy, powerful options to make your website development task much easier.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

656 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