Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 28th, 2003, 03:04 PM
raschma raschma is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Overland Park, KS
Posts: 3 raschma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Reading comma delimited file

I am processing moderately sized (18-20 Meg) comma delimited (.csv) files. My code reads the values from the file using the "INPUT#" statement into explicitly defined variables. As in the following:

'input data from file
Input #1, strDRCCaseId, strDRCID, strDRCRefDate, strCurrentStat, _
strSubStat, strStatChngDate, strStatChngReason, strPatSource, _
strBirthYear, strClinicalTrialSubject

The code goes on to validate the data in terms of length, stated valid values, do dates contain valid dates, etc.

If I remove all screen updates during this file processing, I begin to get phantom characters in the result set as though a buffer is getting written to before it gets cleared. For example, my input file contains the following line:

84302,BC4422591,19991117,A,,19991119,"",E,1987,N,21,02

When I test the status (strCurrentStat), it is expecting a 1 character field, and reports an error that the field contains the following:
A99911171 \ó

This appears to me to be the second field (BC4422591) which has been overlayed by the third field (19991117...resulting in 199911171), overlayed by the fourth field (A... resulting in A99911171 plus some other characters I have no idea where they're coming from).

The kicker is that if I slow the code down by painting to the screen immediately prior to executing the INPUT # statement, the error goes away. Here is the code I'm using to update the screen:
txtRecord.Text = dblCount
txtRecord.Refresh
(note: dblCount is a counter containing the line number of the record being worked with).

Any ideas how to fix the problem without slowing the code with screen updates?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Reading comma delimited file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway