Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xmtextpostoxy(3) [redhat man page]

XmTextPosToXY(library call)											       XmTextPosToXY(library call)

NAME
XmTextPosToXY -- A Text function that accesses the x and y position of a character position SYNOPSIS
#include <Xm/Text.h> Boolean XmTextPosToXY( Widget widget, XmTextPosition position, Position *x, Position *y); DESCRIPTION
XmTextPosToXY accesses the x and y position, relative to the upper left corner of the Text widget, of a given character position in the text buffer. In the case of horizontal writing, the position is the origin of the character. In the case of vertical writing, the position is the verti- cal origin of the character. widget Specifies the Text widget ID position Specifies the character position in the text for which the x and y position is accessed. This is an integer number of characters from the beginning of the buffer. The first character position is 0 (zero). x Specifies the pointer in which the x position is returned. The returned position is the distance from the left side of the wid- get to the left border of the character. This value is meaningful only if the function returns True. y Specifies the pointer in which the y position is returned. The returned position is the distance from the top of the widget to the character's baseline. This value is meaningful only if the function returns True. For a complete definition of Text and its associated resources, see XmText(3). RETURN
This function returns True if the character position is displayed in the Text widget; otherwise, it returns False, and no x or y value is returned. RELATED
XmText(3). XmTextPosToXY(library call)

Check Out this Related Man Page

XmTextFieldPosToXY(library call)										  XmTextFieldPosToXY(library call)

NAME
XmTextFieldPosToXY -- A TextField function that accesses the x and y position of a character position SYNOPSIS
#include <Xm/TextF.h> Boolean XmTextFieldPosToXY( Widget widget, XmTextPosition position, Position *x, Position *y); DESCRIPTION
XmTextFieldPosToXY accesses the x and y position, relative to the upper left corner of the TextField widget, of a given character position in the text buffer. widget Specifies the TextField widget ID position Specifies the character position in the text for which the x and y position is accessed. This is an integer number of characters from the beginning of the buffer. The first character position is 0. x Specifies the pointer in which the x position is returned. The returned position is the distance from the left side of the wid- get to the left border of the character. This value is meaningful only if the function returns True. y Specifies the pointer in which the y position is returned. The returned position is the distance from the top of the widget to the character's baseline. This value is meaningful only if the function returns True. For a complete definition of TextField and its associated resources, see XmTextField(3). RETURN
This function returns True if the character position is displayed in the TextField widget; otherwise, it returns False, and no x or y value is returned. RELATED
XmTextField(3). XmTextFieldPosToXY(library call)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sorting a flat file based on multiple colums(using character position)

Hi, I have an urgent task here. I am required to sort a flat file based on multiple columns which are based on the character position in that line. I am restricted to use the character position instead of the space and sort +1 +2 etc to do the sorting. I understand that there is a previous... (8 Replies)
Discussion started by: cucubird
8 Replies

2. Shell Programming and Scripting

Help needed in character replacement in Korn Shell

How do I replace a space " " character at a particular position in a line? e.g. I have a file below $ cat i2 111 002 A a 33 0011 B c 2222 003 C a I want all the 1st spaces to be replaced with forward slash "/" and the 3rd spaces to have 5 spaces to get the output below: 111/002... (8 Replies)
Discussion started by: stevefox
8 Replies

3. Shell Programming and Scripting

URG!! Last position of a character

Hi. If I have files with names like abcd.20080625.1234.abc.XYZ abcd.20080625.1234.abc.XYZW how can I get the XYZ or XYZW part? is there something like an Index() function but in reverse order? I was thinking that if I can get the position of the last dot... (7 Replies)
Discussion started by: mrodrig
7 Replies

4. Shell Programming and Scripting

Replacing a position in a file

Hi I'm trying to use awk in a file(test123.dat). My requirement is to to check for the 65th position, if the 65th position is a space then replace the 65th position by the number 9. This is the code that i used: awk '{substr($0,65,1) ~ / / }{sub(substr($0,65,1),"9")}{print}' test123.dat ... (7 Replies)
Discussion started by: angelarosh
7 Replies

5. Shell Programming and Scripting

Deleting all characters from 350th character to 450th character from the log file

Hi All, I have a big log file i want to delete all characters (between 350th to 450th characters) starting at 350th character position to 450th character position. please advice or sample code. (6 Replies)
Discussion started by: rajeshorpu
6 Replies

6. UNIX for Dummies Questions & Answers

replace position

my file: S10000000146981+0000003113079+0000000096981 i'd like to copy position 31-44, and paste onto position 3-16 i'd like to replace position 31-44 with 0 (zero) my final file should look like this: S10000000096981+0000003113079+0000000000000 thanks in advanced. (10 Replies)
Discussion started by: tjmannonline
10 Replies

7. Shell Programming and Scripting

replace character only in first line of a file

Hi, I need to replace a character in a specific position in only the first line of a file (actually many files). Change T to a P in position 103. I'm on solaris and my implementation of sed doesn't have the -r capability. Thx, Tim (8 Replies)
Discussion started by: web-guy01
8 Replies

8. Shell Programming and Scripting

Breaking a file into three new files, character by character

I am new to shell scripting, and need a script to randomly distribute each character from a file into one of three new files. I also need each character to maintain it's position from the original file in the new file (such that if a character is written to File 1, Files 2 and 3 have spaces... (10 Replies)
Discussion started by: foxcastle
10 Replies

9. UNIX for Dummies Questions & Answers

To Extract words from File based on Position

Hi Guys, While I was writing one shell script , I just got struck at this point. I need to extract words from a file at some specified position and do some comparison operation and need to replace the extracted word with another word. Eg : I like Orange very much. I need to replace... (19 Replies)
Discussion started by: kuttu123
19 Replies

10. UNIX for Dummies Questions & Answers

Change a character based on its position number

Hi I have a text file that I want to change some of the characters based on their position. My file contain multiple lines and characters should be counted continuously line by line. For example, I want to convert the 150th T to C. What can I do? Here is a portion of my file:... (10 Replies)
Discussion started by: a_bahreini
10 Replies

11. Shell Programming and Scripting

Find character and Replace character for given position

Hi, i want find the character '-' in a file from position 284-298, if it occurs i need to replace it with 'O ' for the position in the file. How to do that using SED command. thanks in advance, Sara (9 Replies)
Discussion started by: Sara183
9 Replies

12. Shell Programming and Scripting

Delete character on specific position

Hi, im still new in unix. i want to ask how to delete character on specific position in line, lets say i want to remove 5 character from position 1000, so characters from position 1000-1005 will be deleted. i found this sed command can delete 4 characters from position 10, but i dont know if... (7 Replies)
Discussion started by: bluesue
7 Replies

13. UNIX for Beginners Questions & Answers

Split by Position

I am on AIX. I need to use AWK to split the source file based on a character at a certain position. Position 75 with a value of 'R' should go in one output file and the rest should go in another file. I need proper names for the output files. Source FileName : abc_xyz_pqr_a_1_yymmdd... (15 Replies)
Discussion started by: techedipro
15 Replies

14. UNIX for Beginners Questions & Answers

Print byte position of extended ascii character

Hello, I am on AIX. When I encounter extended ascii characters and special characters on a file I need to print.. Byte position, actual character and line number. Is there a simple command that can give me the above result ? Thanks in advance (38 Replies)
Discussion started by: rosebud123
38 Replies

15. Shell Programming and Scripting

Remove line break at specific position

Hi, I need to remove line breaks from a file, but only the ones at specific position. Input file: this is ok this line is divided at posit ion 30. The same as this one, also position 30 the rest of lines are ok with different lengths The longest ones are always s plitted at same... (15 Replies)
Discussion started by: qranumo
15 Replies