Beta: Link Text object contents to dates, filenames and filepaths, and worksheet cell contents

We are testing a new feature in Surfer Beta, where you can link text objects to show specific text like the date, the file name or file path, or the contents of a specific cell in a worksheet.

This makes it easy to link text in a map to cell contents in an Excel file, or automatically insert the date the project is edited or the filename, and have the information be entered automatically. You can easily refresh the text if anything changes and it will automatically update.

Insert text into title blocks and figures that automatically include the date, cell contents from a data file, filename or filepath.

 

Making sure our development meets your needs is important to us at Golden Software, so we would like to ask your feedback on this feature.

 

What is this new feature

This feature gives you the option to insert specific text into a text object. The text is inserted using the information at that moment. If anything changes (e.g. the filename changes, or the filepath), you can click the Refresh button to refresh the linked text.

 

You can insert:

  • <<filename>> = Displays the filename only (MyProject.srf)

  • <<filepath>> = Displays the filepath only (c:\Temp\Projects)
  • <<fullpath>>= Displays the filepath and filename (c:\Temp\Projects\MyProject.srf)
  • <<@cell>> = Displays cell contents from the specified worksheet
  • <<date/time>> = Displays any of the defined date/time formats (for more information about supported date/time formats, see the "A Note on Date/Time Formats" section below)

How to use it

You can use these directives to insert any of the above items into an inserted text object. When linking the text, the text will be a timestamp of the information at the time of creation. If the information is  changed (e.g. the date, filename, etc) you can refresh the linked text to automatically update the text.

For example:

  1. Open Surfer Beta

  2. In the Welcome to Surfer dialog, under Files, make sure Sample Files is selected, then select Axes.srf and click Open.

  3. Click Home | Insert | Text
  4. Click in the plot window in some location. The Text Editor opens.
  5. In the Text Editor, enter this text:
    1. Date created: <<MMM dd, yyyy>>
      File name: <<filename>>
      File path: <<filepath>>
      Full file path: <<fullpath>>
      Cell contents:
  6. Then on the last line, click after the last colon and then click the Worksheet button at the bottom of the Text Editor. Select any worksheet, such as ColoradoCities.xlsx from the Surfer Samples folder, and click Open. Click the Insert cell button, enter C3, and click OK. You can see that <<@C3>> was added to the text.
  7. Click OK in the Text Editor and the text item is createdLinkedText1.png
  8. Click File | Save | Save As, and save the file to a new location, with a new name, and click Save.
  9. Note that the text for the file name and paths did not update with the new information. Select the Text object and in the Properties window, on the Text tab, click the Refresh button to the right of Text to update the text

 

A Note on Date/Time Formats

Examples:

Linked text instructions in the Text Editor

Date/Time displayed
<<MMMM dd, yyyy at hh:mmtt>> July 25, 2024 at 11:35am
<<MM/dd/yy>> 07/08/09

 

months = M (upper case)

  • M = 7
  • MM = 07
  • MMM = Jul
  • MMMM = July

days = d (lower case)

  • d = 7
  • dd = 07
  • ddd = Fri
  • dddd = Friday

years = y (lower case)

  • yy = 24
  • yyyy = 2024

hours (12-hr) = h (lower case)

  • h = 7
  • hh =07

hours (24-hr) = H (upper case)

  • H= 7
  • HH= 07

minutes = m (lower case)

  • m= 7
  • mm= 07

seconds = s (lower case)

  • ss = 47 or 07

am/pm = tt (lower case)

  • tt = am

 

 

 

Was this article helpful?
4 out of 4 found this helpful

Comments

0 comments

Please sign in to leave a comment.