Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extracting Data from String
Message
De
09/08/2017 12:15:38
 
 
À
09/08/2017 12:11:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01653172
Message ID:
01653178
Vues:
54
>>>Respected All. Need help in a small coding/command.
>>>I have following Data for example
>>>
>>>PS="F9 B ( A/P LONI\(BK\) TL SHRIRAMPU)31 588 w"
>>>PS="SX B X (A/P) 37 588 n"
>>>PS="F6 B ( (K) /A/P LONI\(BK\) (TL) SHRIRAMPU)31 588 w"
>>>
>>>I Need to Extract Data from PS in the following Manner for these three cases as follows
>>>
>>>F9 B ( A/P LONI\(BK\) TL SHRIRAMPU)
>>>SX B X (A/P)
>>>F6 B ( (K) /A/P LONI\(BK\) (TL) SHRIRAMPU)
>>>
>>>i.e I need Text from first Left Digit to the Last Right Digit Except "31 588 w"
>>>
>>>If I am using NEWPS=STREXTRACT((PS),'',')') I am getting result as
>>>
>>>F9 B ( A/P LONI\(BK\ and the rest of the part is ignored.
>>>
>>>Similarly for F6 B ( (K) /A/P LONI\(BK\) (TL) SHRIRAMPU) I am getting F9 B ( A/P LONI\(BK\
>>>
>>>I need the entire Text starting from Left "F" till the last Bracket i.e if
>>>
>>>PS="PS="F6 B ( (K) /A/P LONI\(BK\) (TL) SHRIRAMPU)31 588 w"
>>>
>>>I need
>>>
>>>F6 B ( (K) /A/P LONI\(BK\) (TL) SHRIRAMPU)
>>>
>>>Please Guide or provide Appropriate Syntax
>>>Regards
>>>Harsh
>>
>>Just to be sure: the sequence "31 588 w" is always in this format? That is, two digits, a space, three digits, another space, and a single letter? Or can it be something else?
>
>Sir there would always be last three Digits/Texts as I mentioned. However there may be case where there can be )31 588 w (i.e ")31" without space) or ) 31 588 w ((i.e ")31" with space)
>or )31 588 x or ) 31 588 x and likewise.
>
>However From Right to Left there will always be a letter followed by two digits then the Bracket ")".
?left(ps,rat(")",ps))
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform