Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Records to cursor after Specific Word
Message
De
15/08/2017 15:03:19
 
 
À
15/08/2017 13:41:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01653315
Message ID:
01653329
Vues:
44
>>>>>>Respected all.
>>>>>>
>>>>>>I have a Text File say abc.Txt which I have taken it in FILETOSTR using FILETOSTR("ABC.TXT").
>>>>>>
>>>>>>The contents of the file are like
>>>>>>
>>>>>>*p290Y*p1400XMobile Number :*p290Y*p1750X9425816183*p333Y*p1400XBill No. & Date :*p333Y*p1750X360108912 28/06/2017*p376Y*p1400XPayment Due Date :*p376Y*p1750X15/07/2017
>>>>>>
>>>>>>I need to create cursor with each record as
>>>>>>
>>>>>>*p290Y*p1400XMobile Number :
>>>>>>*p290Y*p1750X9425816183
>>>>>>*p333Y*p1400XBill No. & Date :
>>>>>>*p333Y*p1750X360108912 28/06/2017
>>>>>>
>>>>>>Please suggest some method to do this
>>>>>>
>>>>>>Regards
>>>>>
>>>>>
lcText='*p290Y*p1400XMobile Number :*p290Y*p1750X9425816183*p333Y*p1400XBill No. & Date :*p333Y*p1750X360108912 28/06/2017*p376Y*p1400XPayment Due Date :*p376Y*p1750X15/07/2017 '
>>>>>lnX = 1
>>>>>do while .t.
>>>>>   if empty(strextract(lcText,'','',lnX,4)) 
>>>>>      exit
>>>>>   Endif
>>>>>   lcResult= strextract(lcText,'','',lnX,4) + strextract(lcText,'','',lnX+1,4)
>>>>>   ? strtran(left(lcResult,len(lcResult)-1),'','')
>>>>>   lnX = lnX + 2
>>>>>Enddo
>>>>
>>>>
>>>> Sir the last Text is not coming properly, Also It seems that I did some Mistake in furnishing my Text Data earlier
>>>>
>>>>My Text Data was this:-
>>>>
>>>>*p290Y*p1400XAccount Number(8U(s1P(s17H(s8V(s0S(s0B(s16602T*p290Y*p1750X405651132(8U(s1P(s17H(s8V(s0S(s3B(s16602T*p333Y*p1400XInvoice Number(8U(s1P(s17H(s8V(s0S(s0B(s16602T*p333Y*p1750X359996996(8U(s1P(s17H(s8V(s0S(s3B(s16602T
>>>>
>>>>and I need This in four records in cursor as :-
>>>>
>>>>*p290Y*p1400XAccount Number(8U(s1P(s17H(s8V(s0S(s0B(s16602T
>>>>*p290Y*p1750X405651132(8U(s1P(s17H(s8V(s0S(s3B(s16602T
>>>>*p333Y*p1400XInvoice Number(8U(s1P(s17H(s8V(s0S(s0B(s16602T
>>>>*p333Y*p1750X359996996(8U(s1P(s17H(s8V(s0S(s3B(s16602T
>>>>
>>>>i.e I need to break after every I need to *p...Y where .... may be a three or four numeric digit.
>>>>
>>>>
>>>>Please Guide.
>>>
>>>I am not able to copy the text from the screen since it contains invisible characters. Please attach a zipped file containing the data instead. The more records it contains, the bigger chance I have for creating working code.
>>
>>Sir, The required file is attached.
>
>This will give you a starting point. It works correctly for the first "record", I don't have the time to analyze more.

Thanks Sir, will do
Regards
Harsh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform