Re: Sorting a file dynamically

2009-01-30 Thread Rob Dixon
Anirban Adhikary wrote: > Dear list > I want to sort a file which contains the following data. > > SUDIP,PQR,OFFICER,15000 > DIPAK,ABC,CLERK,7500 > CHANDAN,MNP,MANAGER,12000 > WASIM,PQR,CLERK,12000 > PROTIK,XYZ,MANAGER,14000 > DIPAK,XYZ,ADMIN,17000 > > > now I have written a program which will s

Sorting a file dynamically

2009-01-30 Thread Anirban Adhikary
Dear list I want to sort a file which contains the following data. SUDIP,PQR,OFFICER,15000 DIPAK,ABC,CLERK,7500 CHANDAN,MNP,MANAGER,12000 WASIM,PQR,CLERK,12000 PROTIK,XYZ,MANAGER,14000 DIPAK,XYZ,ADMIN,17000 now I have written a program which will sort the file based on column 1, column 2 and col

Re: Sorting a file

2001-05-14 Thread Jeff Pinyan
On May 14, Paul Cotter said: >next if /^#?$/; # skip empty lines and comment lines No. I had a bad regex weekend (as Paul could personally attest to). The author asked the same question. next if /^(#|$)/; will work, as well next if /^#/ or /^$/; I'm sorry about the mixup. I had origi

Re: Sorting a file

2001-05-13 Thread Jeff Pinyan
On May 13, Jeff Pinyan said: >if (/(?:^|\@)(\S+)/) { I had a precedence error in my code here. That regex will match at the beginning of the line every time. It should be: if (/\@(\S+)/ or /(\S+)/) { # ... } Sigh. And I'm writing a book about these. I should get my act together

Re: Sorting a file

2001-05-13 Thread Jeff Pinyan
On May 13, Thomas Leuxner said: >#mydomain.com >mydomain.com anything >[EMAIL PROTECTED] tlx > >#newdomain.com >newdomain.com anything > > >#somewhere.com >somewhere.com anything > I suggest you make a hash of array reference

Sorting a file

2001-05-13 Thread Thomas Leuxner
Hi, i'm currently writing a configuration tool for postfix virtual tables. Right now each new mailalias/account is appended to the postfix "virtual"-file, which works fine. There are checks if there is already a domain-placeholder like "#mydomain.com" in that file, if not one is appended plus a