Turning Carriage Return / Line Feeds into HTML Line Breaks in Inmagic Genie

by Jonathan Jacobsen Wednesday, February 25, 2009 10:36 AM


If you have imported information into Genie from another source, using TextWorks or the importer, or typed it in directly in TextWorks, you may have lines of text that are separated only by line feeds, rather than entered as subfields.  They may have appeared to have the correct layout in TextWorks, but when displayed on the web in Genie, may appear to run together.

For example, text that started out like this:


Chapter 1: Feasibility

Chapter 2: Accountability

Chapter 3: Operational Issues

may appear online as:

ContentsChapter 1: FeasibilityChapter 2: AccountabilityChapter 3: Operational Issues

To have this appear as intended in Genie, you could edit each record individually in the Genie Catalog, but a faster way is to use TextWorks to Batch Replace those line breaks with subfield marks. (You will need to have access to the TextWorks Windows client to do this) .

To do this:

1. In TextWorks, search for all records with data in the field requiring modification, using the * wildcard in that field.

2. Select Records > Batch Modify from the TextWorks menu.

3. Complete the Batch Modify dialogue as follows:

  • Field to Modify: select the field requiring modification
  • Operation: "Substitute Text"
  • Affects: Matching
  • Find What: {LF}
  • Replace With: {SF}

{LF} represents a line feed or paragraph break. {SF} represents a subfield indicator.

4. Perform the batch modification to change all occurrences of the line feed character in the selected field in the selected records to a subfield indicator, then check the results in Genie.

Note: If you are at all in doubt about the batch modification process, backup your complete database before making any changes.

Next, you would edit the MyReports.config configuration file. In this file, find the OPACFull report and the relevant field within that report definition, and add the following line:


e.g. <Field Name="CatAbstract" Separator="&lt;br/&gt;"/>

This causes every subfield to be separated with the <br/> tag. Repeat for the CatalogFull report and any other reports in which this field appears.

Another option in Genie is to edit the MyReports.config file to wrap the field in <pre> tags, which causes the text to display exactly as entered, without the use of subfields. The disadvantage of this approach is that the text will appear in a fixed-width font and long lines will not wrap. If you wish to try this, edit the field definition as described above, in MyReports.config, to add

Header="&lt;pre&gt;"and Footer="&lt;/pre&gt;"

e.g. <Field Name="CatAbstract" Header="&lt;pre&gt;" Footer="&lt;/pre&gt;"/>

and see if you like this look in Genie.


blog comments powered by Disqus

Month List