[Za-pm] Scripting

Spike spikeh at mweb.co.za
Wed Jun 1 23:40:22 PDT 2005


Interesting - we have had (so far) three totally different solutions to the 
same problem! - cool stuff perl.




At 2005/06/02 07:30, Spike wrote:
>#!/bin/perl -w
>
>$/ = '';   # set the record delimiter to a paragraph
>
>while (<>) # or (<FILE>) if you opened one
>{
>         chomp;
>          s/\n/,/g;
>         print "$_\n";
>}
>
>
>__END__
>expected:-
>id 10,bbb 20,ccc,ddd 1,eee 2
>id 11,bbb 20,ccc 1,ddd 1,eee 2
>
>
>
>At 2005/06/01 16:19, Samuel Fourie [ MTN - Innovation Centre ] wrote:
>>hi
>>
>>can anyone please help me ... i need to rewrite these info
>>
>>id 10
>>bbb 20
>>ccc
>>ddd 1
>>eee 2
>>
>>id 11
>>bbb 20
>>ccc 1
>>ddd 1
>>eee 2
>>
>>id 12
>>bbb 20
>>ccc
>>ddd 1
>>eee 2
>>
>>in this form
>>
>>id 10,bbb 20,cc ,ddd 1,eee 2
>>id 11,bbb 20,cc 1,ddd 1,eee 2
>>id 12,bbb 20,cc ,ddd 1,eee 2
>>
>>with a script
>>
>>regards
>>
>>spee
>>
>>
>>
>>
>>
>>
>>
>>
>>-----Original Message-----
>>From: za-pm-bounces at pm.org [ mailto:za-pm-bounces at pm.org] On Behalf Of
>>Tielman De Villiers
>>Sent: Wednesday, 01 June 2005 3:45 PM
>>To: za-pm at pm.org
>>Subject: Re: [Za-pm] List alive?
>>
>>
>>
>>-----Original Message-----
>>From: za-pm-bounces at pm.org [ mailto:za-pm-bounces at pm.org]On Behalf Of
>>Walter Kruse
>>Sent: 01 June 2005 14:40
>>To: za-pm at pm.org
>>Subject: Re: [Za-pm] List alive?
>>
>>
>>---- I am here, but it's very quiet.
>>
>>
>>
>>dead quiet.
>>
>>
>>
>>**********************************************************************
>>This email and any files transmitted with it are confidential and
>>intended solely for the use of the individual or entity to whom they are
>>addressed. If you have received this email in error please notify the
>>system manager.
>>
>>This footnote also confirms that this email message has been swept by
>>MIMEsweeper for the presence of computer viruses.
>>
>>www.mimesweeper.com
>>**********************************************************************
>>
>>_______________________________________________
>>Za-pm mailing list
>>Za-pm at pm.org
>>http://mail.pm.org/mailman/listinfo/za-pm
>>
>>
>>NOTE: This e-mail message is subject to the MTN Group disclaimer see 
>>http://www.mtn.co.za/default.aspx?pid=34411
>>
>>_______________________________________________
>>Za-pm mailing list
>>Za-pm at pm.org
>>http://mail.pm.org/mailman/listinfo/za-pm
>_______________________________________________
>Za-pm mailing list
>Za-pm at pm.org
>http://mail.pm.org/mailman/listinfo/za-pm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/za-pm/attachments/20050602/5e4167fd/attachment.html


More information about the Za-pm mailing list