Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extracting Data from String
Message
De
09/08/2017 12:09:42
 
 
À
09/08/2017 11:56:09
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:
01653175
Vues:
51
>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

In your samples, you always remove the 8 last characters, is that always the case?

If so, this will do: ?left(ps,len(ps)-8)

If not, please provide some more realistic samples of what you have and what you want.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform