Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dxmcstextreplace(3x) [osf1 man page]

DXmCSTextReplace(3X)													      DXmCSTextReplace(3X)

NAME
DXmCSTextReplace - Replaces a specified segment of text in a compound string text widget. SYNOPSIS
DXmCSTextStatus DXmCSTextReplace( Widget widget, int from_pos, int to_pos, XmString value ); PARAMETERS
The identifier (widget ID) of the compound string text widget. An integer that represents the first character position of the text being replaced. An integer that represents the last character position of the text being replaced. Replacement text for part of the current text in the compound string text widget, or additional text to be inserted into the compound string text widget. DESCRIPTION
The DXmCSTextReplace routine replaces part of the text in the compound string text widget. Within the widget, positions are numbered starting at 0 and increasing sequentially. For example, to replace the second and third characters in the text, from_pos should be 1 and to_pos should be 3. To insert text after the fourth character, from_pos and to_pos should both be 4. RETURN VALUES
A value that represents the status (success or failure) of the replace operation, as follows: -------------------------------------------------------- Value Description -------------------------------------------------------- DXmCSTextStatusEditDone Text replaced successfully. DXmCSTextStatusEditError Text not replaced (failure). -------------------------------------------------------- SEE ALSO
DXmCreateCSText(3X), DXmCSTextSetString(3X), DXmCSTextGetString(3X) DXmCSTextReplace(3X)

Check Out this Related Man Page

XmTextReplace(library call)											       XmTextReplace(library call)

NAME
XmTextReplace -- A Text function that replaces part of a text string SYNOPSIS
#include <Xm/Text.h> void XmTextReplace( Widget widget, XmTextPosition from_pos, XmTextPosition to_pos, char * value); DESCRIPTION
XmTextReplace replaces part of the text string in the Text widget. The character positions begin at 0 (zero) and are numbered sequentially from the beginning of the text. An example text replacement would be to replace the second and third characters in the text string. To accomplish this, the parameter from_pos must be 1 and to_pos must be 3. To insert a string after the fourth character, both parameters, from_pos and to_pos, must be 4. This routine calls the widget's XmNvalueChangedCallback and verification callbacks, either XmNmodifyVerifyCallback or XmNmodifyVerifyCall- backWcs, or both. If both verification callback lists are registered, the procedures of the XmNmodifyVerifyCallback list are executed first and the resulting data is passed to the XmNmodifyVerifyCallbackWcs callbacks. The XmNmotionVerifyCallback is generated if to_pos is less than or equal to the cursor position and the length of value is not the same as the length of the text being replaced, or if the cursor position is between from_pos and to_pos, and the distance from the cursor position to from_pos is greater than the length of value. widget Specifies the Text widget ID from_pos Specifies the start position of the text to be replaced to_pos Specifies the end position of the text to be replaced value Specifies the character string value to be added to the text widget For a complete definition of Text and its associated resources, see XmText(3). RELATED
XmText(3) and XmTextReplaceWcs(3). XmTextReplace(library call)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

need to read 3° character from a text file

Hi, I need a script to read the n° character from a text file. eg: if the text file contains the line "123456" ,I nedd a command to display the number 4, as an example. I tried with awk and printf but it seems only works with words separated with spaces, but in this case I have only one word... (15 Replies)
Discussion started by: piltrafa
15 Replies

2. Shell Programming and Scripting

Search and replace multi-line text in files

Hello I need to search for a mult-line text in a file exfile1 and replace that text with another text. The text to search for is in exfile2 and the replacement text is in exfile3. I work with kornshell under AIX and need to do this with a lot of files. (the file type is postscript and they need... (10 Replies)
Discussion started by: marz
10 Replies

3. Shell Programming and Scripting

Need to split the file

I have a file that has text in the format below /users/test/krachel/ ! Some text ! Some Text /user/test/limo ! some text ! some text ! Some text /user/test/krachel ! Some text How can I seperate the text between a pair of '/users/test/' into seperate files ??? any information... (11 Replies)
Discussion started by: getdpg
11 Replies

4. Shell Programming and Scripting

remove specific lines from flat file using perl

Hi, Here is wat im looking for.. i have a flat file which looks like this.. 00 * * * * .. .. * * text text text COL1 COL2 ----- ----- 1 a (12 Replies)
Discussion started by: meghana
12 Replies

5. Shell Programming and Scripting

Ping text file of ip addressese and output to text file

I am basically a scripting noob, I have some programming logic, and I wouldn't post here if my 3 hours of searching actually found something. So far this is what I have: " #! /bin/ksh List=./pinglist1.txt cat $List | while read ip do Pingable="" ping $ip -n 2 | awk '/100%/ {print... (11 Replies)
Discussion started by: Lasthitlarry
11 Replies

6. UNIX for Dummies Questions & Answers

replacing 1 character with many : tr

Hi All, I would like to know how, iff at all we can, we may use the 'tr' command to replace a single character with multiple characters. eg: if i have a string valued "him", how can i use 'tr' to replace 'i' with "oo" to make "hoom". Just replacing a single character by many. tried:-... (16 Replies)
Discussion started by: hkansal
16 Replies

7. Programming

Reading frm text file

hi, Actually i have a text file which contain data in the following format: ---------------------------------- black pepper john barber steven johnson ------------------------------------ and the list goes on. I'm writing a c program that reads the text file and output the following... (10 Replies)
Discussion started by: kanexxx
10 Replies

8. Shell Programming and Scripting

Create multiple text file from a single text file on AIX

Hi I need to create multiple text files from onc text file on AIX. The data of text files is as below: ********************************************** ********************************************** DBVERIFY: Release 10.2.0.4.0 - Production on Tue Nov 10 13:45:42 2009 Copyright (c) 1982,... (11 Replies)
Discussion started by: lodhi1978
11 Replies

9. Shell Programming and Scripting

Finding a string in a text file and posting part of the line

What would be the most succinct way of doing this (preferably in 1 line, maybe 2): searching the first 10 characters of every line in a text file for a specific string, and if it was found, print out characters 11-20 of the line on which the string was found. In this case, it's known that there... (13 Replies)
Discussion started by: busdude
13 Replies

10. Shell Programming and Scripting

awk and gsub - how to replace only the first X occurrences

I have a text (text.txt) and I would like to replace only the first 2 occurrences of a word (but I might need to replace more): For example, if text is this: CAR sweet head hat red yellow CAR book brown tiger CAR cow CAR CAR milk I would like to replace the word "CAR" with word... (12 Replies)
Discussion started by: bingel
12 Replies

11. Shell Programming and Scripting

Remove a block of Text at regular intervals

Hello all, I have a text files that consists of blocks of text. Each block of text represents a set of Cartesian coordinates for a molecule. Each block of text starts with a line that has a only a number, which is equal to the total number of atoms in the molecule. After this number is a line... (15 Replies)
Discussion started by: marcozd
15 Replies

12. Shell Programming and Scripting

replace character from string

I have a string ----- i want to replace the 3rd '-' with a character How can i do that Basically im trying to do hangman I have added the '-----' string to a file called hash and i have the character in a variable called $input also i have the character location(index) in this variable... (12 Replies)
Discussion started by: omaral
12 Replies

13. Shell Programming and Scripting

Help With String Manipulation

Hi Guru's, I need some help with data manipulation using shell scripting. I know how to replace the whole string but not part of the string. The value after aa= should be replaced with the value in the mail leaving ,OU=111,OU=222,DC=333 as is. Below are the inputs and expected outputs. Input:... (17 Replies)
Discussion started by: Samingla
17 Replies

14. Shell Programming and Scripting

How to find repeated string in a text file

I have a text file where I need to find the string = ST*850* This string is repetaed several times in the file, so I need to know how many times it appears in the file, this is the text files: ISA*00* *00* *08*925485USNR *ZZ*IMSALADDERSP... (13 Replies)
Discussion started by: cucosss
13 Replies

15. Shell Programming and Scripting

Replace dashes positions 351-357 & 024-043 with 0 & replace " " if exis with 04 at position 381-382

I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Discussion started by: lancesunny
11 Replies