[Nottingham] AWK script

stripes stripes at roppa.demon.co.uk
Fri Mar 25 00:41:58 UTC 2011


Hi Cam,

Yes your script works but it is not really the output I wanted it
gives an out put of

Author:
Title:
Author:
Title:
Author:
Title

What I was trying to do with the 3rd loop was to get this.

Author:
Title:
Title:
Title
Title

So I can easily just grab the titles without any editing and dump them
all in an email to the appropriate author to ask what is the
publication status of their papers so I can update the archive. I am
not getting paid for this and have 150 authors so want to make it as
easy as possible.


>> fields = 3
>> 1 is <U+FEFF>Template-Type:
>> 2 is ReDIF-Paper
>
> Yes that is odd!

It is very odd I can't work that out at all.


> I think I would have written something like:
>
> { # in this record, look for the name we want
>  for(i=1;i<=NF;i++)
>  {
>  if ($i ~ name)
>  {
>   print "Found " $i
>   # since the name is right, print the titles in this record
>   for(j=1;j<=NF;j++)
>   {
>     if ($j ~ /Title:/)
>     {
>      print $j
>     }
>   }
>  # finished with this record, no need to continue looking for the
> name in this record
>  break
>  }
>  }
> }

Regards
Stripes



More information about the Nottingham mailing list