field extraction with a csh script

field extraction with a csh script

Post by Benit » Thu, 24 Jan 2002 21:22:35



Hello !

I have a line of text, for instance from a*file :
\centerline{\epsfig{file=file.eps}}

I would like to extract the filename "file.eps" from this line
using grep or sed or awk. Do you know how I can do this ?
The structure of the line is not constant : I don't always have
=filename.ps}, it changes !

--
----------------------------------
pour les reponses, retirer NOSPAM de l'email

 
 
 

field extraction with a csh script

Post by Seb » Thu, 24 Jan 2002 21:36:15


#!/bin/sh
grep '\\centerline{\\epsfig{file=file.eps}}'  yourfile | awk -F= '{print
$2}' | sed -e 's/\}\}//'

there must be more efficient/simpler way :)

HTH
--Seb



Quote:> \centerline{\epsfig{file=file.eps}}

> I would like to extract the filename "file.eps" from this line
> using grep or sed or awk. Do you know how I can do this ?
> The structure of the line is not constant : I don't always have
> =filename.ps}, it changes !


 
 
 

1. how to call csh scripts from inside other csh scripts

I've got a csh script that executes other csh scripts. The problem is that
despite the fact that all the scripts are in my path, if I do not copy the
scripts that are being called into the subdirectory where the master script
is executed, then the master script complains that it cannot find these other
scripts.

Is this something that's a part of csh, or is there a way to actually get this to work?

2. Unix backup: which files should be backed up ?

3. sed field extraction

4. Interrupt masking

5. csh commands within csh scripts

6. kernel 2.1.130 and modules : unresolved symbols

7. Help to find a good book on csh/tcsh to teach myself csh/tcsh script

8. Mac filesystem under Linux?

9. need a kmail extraction script

10. "time" command on AIX in the CSH - field meanings

11. Sourcing a csh script from a ksh script

12. exists any program (script) to port csh scripts to ksh

13. how to handle usig csh scripts from within bash/sh scripts?