Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing a file that's not quite comma-delimited
Message
De
10/07/2007 10:54:58
 
 
À
10/07/2007 09:14:37
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01238841
Message ID:
01238911
Vues:
15
>I have absolutely no control of the output that I'm processing. I have the data as I've shown it and that is the format it will be in.
>
>>Jay,
>>IMHO it'd be best to parse this lowlevel. The format looks like multiple tables wrapped in a single file and not so complex to parse. Highly probable the source have better alternatives as export formats.
>>Cetin
SET STEP ON 

TEXT TO lcInput NOSHOW TEXTMERGE
MSH|^~\&|Medinotes|CP|External||20070705154008||DFT^P03|468D4AD320F3|P|2.4|||AL|||
EVN|P03|20070705154008|20070705154008
PID|1|11384|468AE48A7926||Johengen^Jay||20051108000000||||||||||||
PV1|1|O|Ambulatory Surgery Center^^^^^^^^Ambulatory Surgery Center||||^Cardio^Full|||||||||||||||||||||||||||||||||||||20070705154008||||||
ORC|SN|
FT1|1|||20070705154008||CG||||||||||^^^Ambulatory Surgery Center|||250.00^Diabetes Mellitus Without Mention Of Complication, Type II Or Unspecified Type, Not Stated As Uncontrolled^I9|^Cardio^Full|||||99212^Office Or Other Outpatient Visit For The Evaluation And Management Of An Established Patient, Which Requires At Least Two Of These Three Key Components: A Problem Focused History; A Problem Focused Examination; Straightforward Medical Decision Making. Counseling And/Or Coordination Of Care With Other Providers Or Agencies Are Provided Consistent With The Nature Of The Problem(s) And The Patient's And/Or Family's Needs. Usually, The Presenting Problem(s) Are Self Limited Or Minor. Physicians Typically Spend 10 Minutes Face-To-Face With The Patient And/Or Family.^C4|
DG1|1||250.00^Diabetes Mellitus Without Mention Of Complication, Type II Or Unspecified Type, Not Stated As Uncontrolled^I9|||F

ENDTEXT


* you would do this instead of the text...endtext:
* lcInput= FILETOSTR("YourFileName.txt")

*lnNumRecs=ALINES(la1,lcInput)

FOR I = 1 TO ALINES(la1,lcInput)
	lcCurrentRecord="|"+la1[m.I]
	f1=GETWORDNUM(lcCurrentRecord,1,"|")
	f2=GETWORDNUM(lcCurrentRecord,2,"|")
	f3=GETWORDNUM(lcCurrentRecord,3,"|")
	?f1
	?f2
	?f3
	?
	?
	

ENDFOR 
Peter Cortiel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform