Solved

VFP9 CSV Parse Against Cursor Values

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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 many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

912 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

27 Experts available now in Live!

Get 1:1 Help Now