Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    Making a global replace on bibliographic file

    • Article Type: General
    • Product: Aleph
    • Product Version: 18.01

    Description:
    I have an output file of bibliographic records, and I want to change all cases of
    [offprint]
    to
    $$g(offprint)
    How can I?
    for example
    ABC 0000475 1001 L $$aByrd, Keith E. [offprint]
    to
    ABC 0000475 1001 L $$aByrd, Keith E. $$g(offprint)

    Resolution:
    You may do as follows, where the file is called "filename":
    perl -pi.bck -e 's/\[offprint\]/\$\$g(offprint)/g' filename
    It will make the change and also save a copy of the oprinal file with suffix bck. See below:
    ABC-M330>>more filename
    ABC 0000475 1001 L $$aByrd, Keith E. [offprint]
    ABC-M330>>perl -pi.bck -e 's/\[offprint\]/\$\$g(offprint)/g' filename
    ABC-M330>>ls -lrt filename*
    -rw-rw-r-- 1 m325 aleph 49 Jul 21 10:05 filename.bck
    -rw-rw-r-- 1 m325 aleph 52 Jul 21 10:06 filename
    ABC-M330>>diff filename filename.bck
    1c1
    < ABC 0000475 1001 L $$aByrd, Keith E. $$g(offprint)
    ---
    > ABC 0000475 1001 L $$aByrd, Keith E. [offprint]

    Additional Information

    Version 16 global changes on bibliographic file


    • Article last edited: 10/8/2013