06-23-2008
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 (.) I can use substr, but i dont know how to get the last position of a character.
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi ,
I am required to view the fixed postion file very often . I am looking for the utility like this
if the file has a one or multile line
abcdefghijklmnopqr
Utility should make my file look like this
12345678910111213141516--------------------------
abcdefghijk l m n o p q r ... (4 Replies)
Discussion started by: akrathi
4 Replies
2. UNIX for Dummies Questions & Answers
Hello all,
I have a script which picks up a series of large numbers, each of which are actually amalgamations of a series of other numbers. Unfortunately there are no separator characters so I can't use awk -F. I am looking for a way of splitting them into variables according to their... (4 Replies)
Discussion started by: michaeltravisuk
4 Replies
3. Shell Programming and Scripting
I want to insert space in 7th position of all the lines usign vi editor or sed command
Input file
12345689010
abcdefghijk
.
.
Output file
123456 89010
abcdef ghijk
.
. (7 Replies)
Discussion started by: Jairaj
7 Replies
4. Shell Programming and Scripting
Hi,
Can some one guide me to identify the position of a character using index in UNIX.
I have a record like "17/11/2010 15:16:39;reject;10.44.48.65;daemon alert; src: 10.44.48.112; dst: 172.21.52.88" . I need to identify the value which comes after _src:_ (_ denotes space).
I am able to... (15 Replies)
Discussion started by: suneel.mekala
15 Replies
5. Shell Programming and Scripting
hi ,
i am having a file
Full_ARTMAS_20110510152425.xml in my local directory. i wanted to extract the character at the 35143546 th position at line 1 of this file.Can any body help me how to do it???
regards
Anjali (2 Replies)
Discussion started by: angel12345
2 Replies
6. Shell Programming and Scripting
i want to find the position of a character in a line , the first position, last, 5th occurence position , i ve tried grep -n , and expr index but they dont fit the bill. Please let me know if there is any other alternative (2 Replies)
Discussion started by: phpsnook
2 Replies
7. Shell Programming and Scripting
Hi all
let's say i have a file named 1234_v2_abcd
i need to find the position of the character located after _v, in above case this would be character number 2
the count of the characters before _v can change, but i always have a number after _v
can anybody help :) (4 Replies)
Discussion started by: gigagigosu
4 Replies
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
How can I represent the position of 1 (considering only the 1s after the colon) in the word from field5 and above; counting from right to left.
Input:
TT-124 06-03-14 08-02-10 FAS CAT1:10
TT-125-1 05-03-14 10-06-08 CAS CAT2:1010 FAT1:10000
TT-125-3 07-03-14 11-02-06 FAS FAT1:1101... (6 Replies)
Discussion started by: aydj
6 Replies
10. Shell Programming and Scripting
I will appreciate if you help me here in this script in Solaris Enviroment.
Scenario:
i have 2 files :
1) /tmp/TRANSACTIONS_DAILY_20180730.txt:
201807300000000004
201807300000000005
201807300000000006
201807300000000007
201807300000000008
2)... (10 Replies)
Discussion started by: teokon90
10 Replies
LEARN ABOUT REDHAT
xmtextpostoxy
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)