RE: remove carriage return
Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Rquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: remove carriage return
use strict; use warnings; my $input_file = input.txt; open (INFILE, $input_file) or die Can't open $input_file! $!\n; my @input = INFILE; foreach (@input) { chomp; next if (/^\D/); print $_\n; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 10:04 To: [EMAIL PROTECTED] Subject: RE: remove carriage return Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Réquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: remove carriage return
Thanks it works but it deletes the line which not begins with a number, i wanted to put what is not beginning with a number and at the beginning of a new line to the continuation of the preceding line. I hope you understand what i want to do. Thanks. -Message d'origine- De: Beckett Richard-qswi266 [mailto:[EMAIL PROTECTED] Date: vendredi 18 juillet 2003 13:01 : SII - GONCALVES, Jorge; [EMAIL PROTECTED] Objet: RE: remove carriage return use strict; use warnings; my $input_file = input.txt; open (INFILE, $input_file) or die Can't open $input_file! $!\n; my @input = INFILE; foreach (@input) { chomp; next if (/^\D/); print $_\n; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 10:04 To: [EMAIL PROTECTED] Subject: RE: remove carriage return Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Rquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: remove carriage return
use strict; my @out; foreach() { chomp; if (/^\d+;/) { push @out, $_; } else { if (defined $out[-1]) { $out[-1] .= $_; } } } $,=\n; print @out, ; -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoy : vendredi 18 juillet 2003 11:04 : [EMAIL PROTECTED] Objet : RE: remove carriage return Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Rquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs * Ce message et toutes les pices jointes (ci-aprs le message) sont confidentiels et tablis l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorise est interdite. Tout message lectronique est susceptible d'altration. La SOCIETE GENERALE et ses filiales dclinent toute responsabilit au titre de ce message s'il a t altr, dform ou falsifi. This message and any attachments (the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. * ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: remove carriage return
C:\tmptype in.txt 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Réquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des C:\tmpperl -pe BEGIN{ $\=qq{};} chomp; print qq{\n} if($.1/^\d/); in.txt 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance -Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole-Bouygtel/Fraude/FRD : Geole/Réquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G :LM-Forfait/Gestion Des Hope this helps Tobias -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, July 18, 2003 5:54 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: remove carriage return Thanks it works but it deletes the line which not begins with a number, i wanted to put what is not beginning with a number and at the beginning of a new line to the continuation of the preceding line. I hope you understand what i want to do. Thanks. -Message d'origine- De: Beckett Richard-qswi266 [mailto:[EMAIL PROTECTED] Date: vendredi 18 juillet 2003 13:01 À: SII - GONCALVES, Jorge; [EMAIL PROTECTED] Objet: RE: remove carriage return use strict; use warnings; my $input_file = input.txt; open (INFILE, $input_file) or die Can't open $input_file! $!\n; my @input = INFILE; foreach (@input) { chomp; next if (/^\D/); print $_\n; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 10:04 To: [EMAIL PROTECTED] Subject: RE: remove carriage return Hi dear perl users, I have a file like this: .. 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance - Paiement/Rechargements/ppc_tools;W_REM_QUA 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole -Bouygtel/Fraude/FRD : Geole/Réquisition/IHMREQ;W_FRD_QUA 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des .. and what i wanted is to remove carriage return and to have lines which begin with only with number like this 31563;qualified;REMUS;IPR;05/11/2002;REMUS 6.30;-Bouygtel/REMUS/Instance 31617;standby;DIAMANT-SIEBEL;IPR;06/11/2002;DIASBL 1.1;-Bouygtel/DIAMANT-SIEBEL;W_DIASBL_MOE 31646;entered;Fraude;HLP;06/11/2002;GEOLE 2.5.1;-Bouygtel/Fraude/FRD : Geole 31853;in_review;S3G : LM-Forfait;VSR;13/11/2002;GESDEM;-Bouygtel/S3G : LM-Forfait/Gestion Des... Is it possible in perl and how can i do this? thanks for your help. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs