Formatting "Copy-to-Clipboard"

Overview

EpiData EntryClient provides a few default format to choose from, but it is possible to create your own format from a few simple principles.

The format line may contain normal text (this includes spaces, non-ascii text, special characters, etc.) and a small set of predefined qualifiers with special meaning.

The copy function works such that each field on the form is written to the clipboard using the specified format and concatenated with eachother.

Specifiers

Globals

Specifier Meaning
%gd Include current date and time
%gn Include project file including full path
%gc Include project cycle no.
%gp Include project title
%gf Include dataform name

Global content have a pre-specified format.

Local field oriented parameters

Specifier Meaning
%f Returns the Field Name (even if it not shown on the form)
%q Returns the Field Question
%v Returns the label part of a valuelabel if availble (even if the label is not shown on the form)
%l Returns the label part of a valuelabel if exists otherwise returns data for the record
%d Returns the current data for the record (or blank if no data)

Others

Specifier Meaning
%t Inserts a “tab” into the text
%n Inserts a “newline” into the text (usefull for have eg. each field on a seperate line)
%% Insert the character “%” into the text (otherwise the program interprets the % as a specifier.

There is no limit to the number of uses for a specifier in the format line. Any text written into the format (without a specifer) will be added to all output.

Examples

Consider the following fields with questions, data and valuelabels:

Field Name Question Data Valuelabel (label part)
V1 Identifier 1000
V2 Name Smith
V3 Gender 1 Male
V4 Age 50

Example 1

Using the format line: %f,%q,%d,%v%n

Will produce this result:

V1,Identifier,1000,,
V2,Name,Smith,,
V3,Gender,1,Male,
V4,Age,50,,

Example 2

Using the format line: %f:%d,

Will produce this result:

V1:1000,V2:Smith,V3:1,V4:50,
documentation/clipboardformat.txt · Last modified: 2015/08/24 11:49 by torsten.bonde.christiansen
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki