Skip to main content

TextHistogram

TextHistogram [ flags ] srcTextWave

The TextHistogram operation computes the histogram of a text wave where the output bins represent the counts of occurrences of each unique string found in srcTextWave.

The TextHistogram operation was added in Igor Pro 9.00.

Flags

/CIPerforms case-insensitive string comparison.
If you omit /CI TextHistogram performs case-sensitive comparison unless you include /LOC.
/DN=binsCountsWaveSpecifies the numeric output wave that contains the count for each bin. If you omit /DN, the numeric output wave is created in the current data folder and named W_TextHistogram.
/DT=binsTextWaveSpecifies the text output wave that contains the strings corresponding to each bin. If you omit /DT, the text output wave is created in the current data folder and named T_TextHistogram.
/FREECreates all output waves as a free waves.
/FREE is permitted in user-defined functions only. If you use /FREE then all output wave parameters must be simple names, not paths or $ expressions.
See Free Waves for details on free waves.
/LOCPerforms case-insensitive string comparison following locale-aware rules. This option results in significantly slower performance.
/SORT=modeSets the order of the output bins.
mode=1:The output waves are ordered from the bin with the largest count to the bin with the smallest count. This is the default if you omit /SORT.
mode=2:The output waves are ordered from the bin with the longest string to the bin with the shortest string.
/ZSuppress errors. You can use V_Flag to detect and handle errors yourself.

Details

TextHistogram does case-sensitive string comparisons unless you specify /CI or /LOC in which case it does case-insensitive string comparisons.

TextHistogram scans srcTextWave and counts matching string entries. It treats text waves of all dimensions as if they were 1D waves.

The output of the operation consists of two waves: a text wave containing the text corresponding to each bin and a numeric wave containing the bin counts. You can specify the destination waves using the /DT and /DN flags. If you omit /DT the text output wave is created in the current data folder and named T_TextHistogram. If you omit /DN the numeric output wave is created in the current data folder and named W_TextHistogram. The output waves overwrite any previously-existiing waves with the same names.

The operation creates automatic wave references for the output waves specified by /DT and /DN. See Automatic Creation of Wave References for details. It does not create wave references for the default output waves created if you omit /DT or /DN so you need explicit wave references.

When using case-insensitive mode the output text wave may use any one of the equivalent forms of the text represented by the bin.

Output Variables

TextHistogram sets the following output variable:

V_flag0 if the operation succeeded or a non-zero error code.

See Also

Histogram, FindDuplicates, Sort