RE: problem with last in looping %

2002-01-30 Thread Kredler Stefan
Nicola, there is another loop. The whole construction looks like this: for(@file1) { $_ =~ s/[\r]|[\n]//;#remove CR and DOS CR $_ =~ s/\"//g; #remove quotes next if ($_ =~ /;;;|DATUM|GESAMT|ANZAHL/); @raw=split /;/,$_; if ( $raw[3]

unit conversion like nm to 10E-9

2001-12-18 Thread Kredler Stefan
Hi all, a while ago I wrote a little unit conversion I am quite happy with. Just out of interest: is there a more elegant way to do it? And maybe even more interesting: what approach should I take to implement the back conversion? Here is my code: #! /usr/gnu/bin/perl -w

RE: summarizing a list of numbers?

2001-12-17 Thread Kredler Stefan
Thanks to all for your ideas, > ~C wrote: >Hope this helps - out of interest, what sort of UNIX command _needs_ a >list like that instead of an explicit one? I have to apologize for my unclear formulation. It is indeed not a UNIX command but a UNIX programm being controlled via command line. My

summarizing a list of numbers?

2001-12-17 Thread Kredler Stefan
Hello All, I want to transform a sorted list into a compact list (if this is the correct term). e.g. my list is 9,11,12,13,14,23,25,26,27,50and want to have something like 9,11-14,23,25-27,50 (to pass on to a unix-command). Is there any module or function I can use to summariz

RE: perl script to remove control M's

2001-12-07 Thread Kredler Stefan
Since emacs is being used why not using emacs' buildin serep function? Macro: M-< ;; beginning-of-buffer M-% ;; query-replace C-q ;; quoted-insert C-m ;; newline 2*RET ;; newline !

regular expression matching exact numbers

2001-09-25 Thread Kredler Stefan
Hello, I'd like to match numbers and add them to an array if the array does not contain the number. let's assume $part[1] can hold the values in consecutive order e.g. 5, 1005, 5, 2000 then next if (grep /$part[1]/, @tnumlist); push @tnumlist,$part[1]; would yield @tnumlist