This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Elias, > To: address@hidden > From: address@hidden (Elias Diab) > Subject: Perl question > Organization: . > Keywords: 199609161504.AA04001 In the above message you wrote: > I have some files, in which exist some ( too many !) links to other files ! > the format of these links is: filename.xxx.html and I want to substitute > all these filenames to the following format: filename.html and after > that,instead of .html I want to have .htm in all the files ! > What is the substitution command to do that, please ? > I'll write down for you this example, to make it clear for you: > > > let's suppose this is the content of one of the files that I have: > > <h2> > <li> > <a href="tw5cc010.ctl.html"> Temp data: APS control system </a> > </h2> > > So, instead of tw5cc010.ctl.html ,I need to have tw5cc010.html and than > tw5cc010.htm , and so on for the rest thousands links ! > > Can you please help me to do this ? > Maybe, it's very simple, but I don't have any idea about Perl !!!! Rather than create a netCDFPerl script to do the above, I'd probably just use the netCDF ncdump(1) utility to convert the netCDF file into a formated file, then use something like the UNIX sed(1) utility to perform the substitutions, and the convert the file back into a netCDF file via the netCDF ncgen(1) utility. Please let me know if this helps. -------- Steve Emmerson <address@hidden>