Re: Text processing on VMS

Liste des GroupesRevenir à co vms 
Sujet : Re: Text processing on VMS
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vms
Date : 14. Oct 2024, 01:14:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vehnou$sitc$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 10/13/2024 6:24 PM, Craig A. Berry wrote:
On 10/13/24 2:26 PM, Arne Vajhøj wrote:
But in a relevant script language then it should be a one statement
problem (although in most cases splitting that one statement over
multiple lines is a good thing for readability).
>
import java.nio.file.*
>
Files.lines(Paths.get("login.com"))
      .filter(line -> line.contains("java"))
      .map(line -> line[2..12])
      .forEach(System.out::println)
>
output pos 2..12 (pos is 0 based!) from all lines of login.com
that contains "java".
 Opening an editor, typing all that in, running the java compiler, and
then running the compiled program all seems like a lot of work to me
when all you need to do is:
 $ perl -nE "say substr($_, 2, 12) if $_ =~ m/java/i;" < login.com
It is not Java but Groovy, so compile is optional.
And groovysh does have an -e for evaluating code given in command line
(it is just rarely used).
But you are absolutely right: Perl code is shorter than Groovy code.
Arne

Date Sujet#  Auteur
13 Oct 24 * Text processing on VMS17David Meyer
13 Oct 24 +* Re: Text processing on VMS2Chris Townley
14 Oct 24 i`- Re: Text processing on VMS1David Meyer
13 Oct 24 +- Re: Text processing on VMS1Craig A. Berry
13 Oct 24 +* Re: Text processing on VMS12Arne Vajhøj
13 Oct 24 i`* Re: Text processing on VMS11Dave Froble
13 Oct 24 i `* Re: Text processing on VMS10Arne Vajhøj
13 Oct 24 i  +* Re: Text processing on VMS5Craig A. Berry
14 Oct 24 i  i`* Re: Text processing on VMS4Arne Vajhøj
14 Oct 24 i  i +- Re: Text processing on VMS1Arne Vajhøj
14 Oct 24 i  i +- Re: Text processing on VMS1Arne Vajhøj
14 Oct 24 i  i `- Re: Text processing on VMS1Arne Vajhøj
14 Oct 24 i  `* Re: Text processing on VMS4Arne Vajhøj
14 Oct 24 i   +* Re: Text processing on VMS2Simon Clubley
14 Oct 24 i   i`- Re: Text processing on VMS1Arne Vajhøj
14 Oct 24 i   `- Re: Text processing on VMS1Dave Froble
13 Oct 24 `- Re: Text processing on VMS1Stephen Hoffman

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal