Sometimes you’ll need to take an existing field that already has data in it and split it apart. This can be accomplished with the Split Field dialog (accessed from the tool bar or the Fields menu). To use this dialog you choose how the field should be split, type in names for the new fields, and press the Split button. In this example a combined Name field is split into separate First and Last fields.
Controlling the Split Location
Panorama can split a field at any of three dozen different characters or symbols, or at a specific character position. For example, an e-mail address can be split into user name and ISP by splitting at the @ symbol.
You don’t have to split at the first instance of a character - you can choose any of the first or last nine instances. In this example the split occurs after the third / symbol.
If you choose to split at a character position instead of at a character or symbol, the pop-up menu expands to allow you to select up to the first 50 positions. In this example a phone number is split into separate area codes and local numbers by splitting after the sixth character (this is just one way to split a phone number, another method will be described later).
Stripping Extra Spaces and Punctuation
Sometimes after you split a field there will be extra spaces or punctuation that needs to be removed. For example, suppose you want to split a field containing Last, First names into separate last and first names. This can easily be done by splitting on the comma, but there’s a problem — an extra space at the beginning of each first name. To remove this extra space check the Strip surrounding Blanks checkbox.
Sometimes you’ll need to strip off punctuation in addition to or instead of blanks. In this example the dialog is splitting a phone number into separate area codes and local numbers. To eliminate the ( and ) around the area code check the Strip Surrounding Punctuation option.
If necessary, you can always perform additional cleanup with the Morph Field Dialog after the fields have been split.
Partial Splits
Usually splitting involves turning one field into two, but sometimes you just want to keep one part of the original field and discard the rest. To do that just uncheck the side of split that you don’t want.
Sometimes a useful option is to do a partial split combined with keeping the original field. For example, you could split an email field to create a separate ISP field, while keeping the email field instact.
Splitting Non-Text Fields
It’s possible, though unusual, to split numeric or date fields. The number or date is converted to text before being split, and the resulting fields are always text fields. You may need to set the output pattern for the date or number field before you split it to get the format you want.
See Also
- addfield -- adds a new field to the current database (on the end).
- Adding New Fields -- adding one or more fields to a database.
- autoallfieldwidths -- automatically sets the width of all fields based on the data in each field.
- autofieldwidth -- automatically sets the width of the current field based on the data in it.
- Automatic Field Calculations -- performing formulas automatically when data is entered into a field.
- Automatic Field Code -- running a short program when data is entered into a field.
- automaticfieldchoices -- updates the current field's Choice list with actual data in the database.
- automaticfieldname( -- returns an available field name.
- cell -- enters a value into the currently active field (i.e. cell).
- checkdesignlock -- checks if field structure can be changed, if not, returns an error.
- commonfieldspopup -- pops up a list of common fields, and changes the current field specifications when a field is chosen from this menu.
- Construct Multiple Fields -- using a template to quickly add multiple fields to a database.
- constructfields -- creates one or more new fields based on a template.
- databaseconsoledump -- dumps the raw contents of the specified database to the console in comma delimited format.
- Date Patterns -- control how dates are displayed or converted to text.
- Dates -- working with dates.
- dbinfo( -- gets information about a database: what forms it contains, what fields, what flash art pictures, etc.
- deletefield -- deletes the current field from the database.
- Deleting Fields -- deleting fields from the database.
- Disable Editing of Individual Fields -- disable editing of inidividual database fields in the data sheet and/or forms.
- disablefieldediting -- disables editing for a specified list of database fields (all others are enabled).
- editfield -- begins editing of the specified field.
- editfieldname -- opens the data sheet window's field properties inspector and selects the field name.
- Field Blueprint Dialog -- examining and modifying the raw specification of a field.
- Field Properties -- available field attributes.
- Field Properties Panel -- examining and modifying field attributes.
- Field Width -- adjusting the width of a field in the data sheet.
- fieldalignment( -- returns the alignment of a database field.
- fieldformula( -- returns the formula associated with a database field.
- fieldname -- changes the name of the current field.
- fieldnumber( -- returns the number of a database field (starting with 1).
- fieldpattern( -- returns the output pattern associated with a database field.
- Fields -- introduction to database fields.
- fieldtype -- changes the data type of the current field.
- fieldtypes -- returns a carriage return delimited array with list of fields and field data types.
- fieldtypes( -- returns a carriage return delimited array with a list of the fields and field data types.
- fieldwidth( -- returns the width (in the data sheet) of a database field.
- findreplacedialog -- opens the Find & Replace dialog.
- firstcolumn -- moves to the first column in the data sheet (leftmost column).
- getfieldproperties( -- returns a dictionary containing all of the properties of the specified field. (See the setfieldproperties statement if you want to change one or more field properties.)
- hiddenfields( -- returns a list of hidden fields in the curent data sheet window
- hidecurrentfield -- hides the current field in the data sheet.
- hidefieldsbetween -- shows all fields except those in between specified numbers.
- hidelineitemfields -- hides all line item fields.
- hidethesefields -- hides specific fields in the data sheet, making all others visible.
- Hiding and Showing Fields -- temporarily hiding fields in the data sheet.
- info("datatype") -- returns the data type of the current field.
- info("disabledfields") -- returns a list of disabled fields in the current database (fields that cannot be edited).
- info("enabledfields") -- returns a list of enabled fields in the current database (fields that can be edited).
- insertfield -- inserts a new field into the database in front of the current field.
- lastcolumn -- move to the last column in the data sheet (rightmost column).
- Limiting the Maximum Number of Data Sheet Columns -- adjusting the maximum number of columns displayed in data sheet windows.
- Line Item Fields -- are used for repeating items within a record
- mergefieldsdialog -- opens the standard *Merge Fields* dialog.
- Merging Adjacent Fields -- merging two fields into one.
- movefieldbefore -- moves the current field to a new position.
- newdatabasewithfields -- creates a new database with one or more fields.
- newdatabasewithtemplate -- creates a new database with a template.
- Numeric Data -- numeric data (fixed and floating point).
- Numeric Patterns -- control how a number is displayed or converted to text.
- Rearranging Field Order -- rearranging the order of fields in the data sheet.
- reorderfieldsdialog -- opens the Reorder Fields dialog.
- serverdatabaseconsoledump -- dumps the raw contents of the specified database on the server to the console in comma delimited format.
- setfieldnames -- changes the names of all database fields at once.
- setfieldproperties -- modifies one or more properties (name, data type, formula, etc.) of the current field.
- showallfields -- makes every field in the data sheet visible.
- showcolumns -- forces Panorama to display specified fields.
- showfields -- forces Panorama to display specified fields.
- showfieldsbetween -- hides all fields except those in between specified numbers.
- showhidefieldsdialog -- opens the standard Show/Hide Fields dialog (in the Fields menu).
- showthesefields -- makes specific fields in the data sheet visible, hiding all others.
- Smart Dates -- keyboard entry of dates.
- splitfielddialog -- opens the standard *Split Field* dialog.
- tokenname( -- returns the name of a field or variable (instead of the value contained in the field or variables).
- visiblefieldnumbers( -- returns a data array of visible fields (by number) in the data sheet.
- visiblefields( -- returns a list of visible fields in the data sheet.
History
10.0 | No Change | Carried over from Panorama 6.0 |