I don't know of how to get a c-shell script to do that because I don't know of a way to get regex support into a c-script but I hacked up an example perl script that works for me (below). Assuming the input file is "infile.fil", this reads the whole thing into an array, then processes it line by line from the array
Code:
#!/usr/bin/perl -w
use strict;
use warnings;
open(MF, "<infile.fil");
my @slurp = <MF>;
close(MF);
foreach my $line (@slurp) {
if ($line =~ m/\s+doi:(.*)$/) {
print "$1\n";
}
}
If the input file is really huge, you'd want to not use a slurp style processing of the file but do it line by line.
The \s+ means that any amount of leading white spaces in front of the "doi:" is allowed and matches. But it requires at least one char of space. \s* would do 0 or more white spaces.