Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jan 11th, 2012  |  syntax: Python  |  size: 0.27 KB  |  hits: 62  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. #s is a MARC record as a string
  3.  
  4. SUBFIELD_INDICATOR      = chr( 0x1F )
  5. END_OF_FIELD            = chr( 0x1E )
  6. END_OF_RECORD           = chr( 0x1D )
  7.  
  8. s = s.replace(SUBFIELD_INDICATOR, '#31;')
  9. s = s.replace(END_OF_FIELD, '#30;')
  10. s = s.replace(END_OF_RECORD, '')