Decouper une chaine en PERL
Fermé
frans
-
28 avril 2004 à 10:53
jisisv Messages postés 3645 Date d'inscription dimanche 18 mars 2001 Statut Modérateur Dernière intervention 15 janvier 2017 - 28 avril 2004 à 11:47
jisisv Messages postés 3645 Date d'inscription dimanche 18 mars 2001 Statut Modérateur Dernière intervention 15 janvier 2017 - 28 avril 2004 à 11:47
A voir également:
- Decouper une chaine en PERL
- Découper une video - Guide
- Découper pdf - Guide
- Découper mp3 - Guide
- Chaine tnt gratuite sur mobile - Guide
- Plus de chaine tv - Guide
2 réponses
jisisv
Messages postés
3645
Date d'inscription
dimanche 18 mars 2001
Statut
Modérateur
Dernière intervention
15 janvier 2017
934
28 avril 2004 à 11:45
28 avril 2004 à 11:45
La fonction split doit suffire dans ce cas
(adapter si plusieurs champs)
[johand@zoot] ~/tmp $cat bidon.pl
#!/usr/bin/perl -w
$mystring="BELLAHSENE ANTHONY/CM VIALLE";
@res=split(/\// , $mystring);
print $res[0];
[johand@zoot] ~/tmp $./bidon.pl
BELLAHSENE ANTHONY[johand@zoot] ~/tmp $
Johan
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.
(adapter si plusieurs champs)
[johand@zoot] ~/tmp $cat bidon.pl
#!/usr/bin/perl -w
$mystring="BELLAHSENE ANTHONY/CM VIALLE";
@res=split(/\// , $mystring);
print $res[0];
[johand@zoot] ~/tmp $./bidon.pl
BELLAHSENE ANTHONY[johand@zoot] ~/tmp $
Johan
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.
jisisv
Messages postés
3645
Date d'inscription
dimanche 18 mars 2001
Statut
Modérateur
Dernière intervention
15 janvier 2017
934
28 avril 2004 à 11:47
28 avril 2004 à 11:47
@res=split(/\/CM/ , $mystring);
fonctionne aussi...
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.
fonctionne aussi...
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.