bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] Gawk feature request - file list


From: arnold
Subject: Re: [bug-gawk] Gawk feature request - file list
Date: Fri, 03 Feb 2017 01:46:02 -0700
User-agent: Heirloom mailx 12.4 7/29/08

Hi.

So the way to do that is to put that little bit into a separate
script and run gawk with

        gawk -f filelist.awk -f your-program.awk list-of-data-files.txt

You still have to modify how your scripts are invoked but otherwise
each of your programs remains the same.

Since this is something that can be done pretty easily in awk, I don't
plan to add yet another command line option. Gawk is already burdened
with too many.

Thanks,

Arnold

Daniele Zanoli <address@hidden> wrote:

> hello,
> super good trick!
> but this would require to use it in all my scripts... and it looks like a 
> little 
> bit too "tricky"
> maybe a "public" option would be cleaner to be handled
>
> Unfortunately I'm often using a Windows port of Gawk (I have to run it on 
> several PCs of my colleagues) and the windows shell command line is only 32k 
> characters (or bytes?) long...
>
> I have built a kind of "IDE" which launches awk scripts over files in order 
> to 
> make it simple to use also for non tech people but currently I am limited on 
> the 
> max number of files I can handle.
>
> thanks anyway!
>
> Daniele
>
>
> Original Message  --------
> Subject: Re: [bug-gawk] Gawk feature request - file list
> From: address@hidden
> To: address@hidden, address@hidden
> Date: 1/2/2017, 15:57:18
>
> > Hi.
> >
> > Thank you for your note.
> >
> > Daniele Zanoli <address@hidden> wrote:
> >
> >> Hello,
> >> I'm an enthusiast user of gawk. I hope this is the best address to place a
> >> feature request (I could not find an "official" place for requests)
> >>
> >> Often I have to use gawk on a large number of files with a single 
> >> execution of
> >> gawk (I have to compare some file contents) but it is very easy to reach 
> >> the
> >> maximum length of the shell command line, since files are in different 
> >> paths
> >>
> >> So I think it would be useful (not only for me) a new command line switch 
> >> to
> >> specify a file that contains the names of the files to process (e.g.
> >> gawk .. -list myfilelist.txt ...)
> >>
> >> Best regards,
> >>
> >> --
> >> Daniele
> >
> > This doesn't require a new option; it can be done easily in awk code.
> > Something like the following (untested, but you'll get the idea):
> >
> >     BEGIN {
> >             filelist = ARGV[1]
> >             ARGC--
> >             for (i = 1; (getline filename < filelist) > 0; i++) {
> >                     ARGV[i] = filename
> >                     ARGC++
> >             }
> >     }
> >
> > should do the trick.
> >
> > Hope this helps,
> >
> > Arnold
> >
>
> -- 
> Daniele



reply via email to

[Prev in Thread] Current Thread [Next in Thread]