08-21-2008
how to find a position and print some string in the next and same position
I need a script for...
how to find a position of column data and print some string in the next line and same position
position should find based on *HEADER8* in text
for ex: ord123 abs 123 987HEADER89 test234
ord124 abc 124 987HEADER88 test235
ord125 abg 125 987HEADER887 test236
It should be look like :
for ex: ord123 abs 123 987HEADER89 test234
HEADERREC
ord124 abc 124 987HEADER88 test235
HEADERREC
ord125 abg 125 987HEADER887 test236
HEADERREC
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Folks,
I have a file with all fields defined by byte position, but any field can be empty so I cannot print lines based on a search of specific columns. I need to print all lines of this file where the string of two characters at byte position 100-101 contains the number 27. Any ideas?
... (4 Replies)
Discussion started by: HealthyGuy
4 Replies
2. Shell Programming and Scripting
Hello,
I have a string like
str = "14: Jan 29 13:27:12 : Processor----: : Start of splitting file
"
from this, i have to find the position or location number starting for "Processor". I have to extract date from this entire string.
string which i will give will not have fixed length. ... (2 Replies)
Discussion started by: balareddy
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am a newbie in unix programming so maybe this is a simple question.
I would like to know how can I make a script that outputs only the values that are not between any given start and end positions
Example
file1:
2 30
40 80
82 100
file2:
ID1 1
ID2 35
ID3 80
ID4 81
ID6... (9 Replies)
Discussion started by: fadista
9 Replies
4. Shell Programming and Scripting
Hi,
I have a file named "Test_2008_01_21"
The file contains a string "manual" that occurs many times in the file
How can i find the positions of the string "manual" in the file
Ex: if the string " manual " occurs three times in the file. i want to replace the second occurance of string... (6 Replies)
Discussion started by: bab123
6 Replies
5. Shell Programming and Scripting
I have a file with the below format,
GS*8*****
ST*1********
A*
B*
E*
RMR*123455(This is the unique number to locate this row)
F*
SE*1***
GE**
GS*9*****
ST*2
H*
J*
RMR*567889(This is the unique number to locate this row)
L*
SE*
GE***** (16 Replies)
Discussion started by: Muthuraj K
16 Replies
6. UNIX for Dummies Questions & Answers
Hi,
Can anyone let me know the command to know the list of filenames that have string 31 in their 4th and 5th positions inside the file:
grep -l "31" main*.txt
The above grep lists all the files which have 31 at any position but I want filenames having 31 at position 4 and position 5. (8 Replies)
Discussion started by: okkadu
8 Replies
7. Shell Programming and Scripting
Hi guyz i want to know nth position of character in string. For ex.
var="UK,TK,HK,IND,AUS"
now if we see 1st occurance of , is at 3 position, 2nd at 6,..4th at 13 position.
1st position we can find through INDEX, but what about 2nd,3rd and 4th or may be upto nth position. ?
In oracle we had... (2 Replies)
Discussion started by: Jonty Immortal
2 Replies
8. Shell Programming and Scripting
hi guys,
i want command or script to display the content of file from 2nd position to last but one position of a file
abcdefghdasdasdsd
123,345,678,345,323
434,656,656,656,656
678,878,878,989,545
4565656667,65656
i want to display the same above file without first and... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies
9. Shell Programming and Scripting
Hi,
I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies
10. Shell Programming and Scripting
Hello guys, would you please help me with this?
this is the line inside a file:
first line Something Today YYDDPPSVXIPYYY0XXXOFFS00000000000?
I'd like to find the position of string XXX from string PYYY
In the example above
XXX starts from 6th position from PYYY
desired... (4 Replies)
Discussion started by: netrom
4 Replies
LEARN ABOUT REDHAT
xmtextfindstringwcs
XmTextFindStringWcs(library call) XmTextFindStringWcs(library call)
NAME
XmTextFindStringWcs -- A Text function that finds the beginning position of a wide character text string
SYNOPSIS
#include <Xm/Text.h>
Boolean XmTextFindStringWcs(
Widget widget,
XmTextPosition start,
wchar_t *wcstring,
XmTextDirection direction,
XmTextPosition *position);
DESCRIPTION
XmTextFindStringWcs locates the beginning position of a specified wide character text string. This routine searches forward or backward for
the first occurrence of the string, starting from the given start position. If a match is found, the function returns the position of the
first character of the string in position. If the match string begins at the current position, this routine returns the current position.
widget Specifies the Text widget ID.
start Specifies the character position from which the search proceeds. This is an integer number of characters from the beginning of
the text buffer. The first character position is 0 (zero).
wcstring Specifies the wide character search string.
direction Indicates the search direction. It is relative to the primary direction of the text. The possible values are
XmTEXT_FORWARD
The search proceeds toward the end of the buffer.
XmTEXT_BACKWARD
The search proceeds toward the beginning of the buffer.
position Specifies the pointer in which the first character position of the string match is returned. This is an integer number of char-
acters from the beginning of the buffer. The first character position is 0 (zero). If the function returns False, this value is
undefined.
For a complete definition of Text and its associated resources, see XmText(3).
RETURN
Returns True if a string match is found; otherwise, returns False.
RELATED
XmText(3) and XmTextFindString(3).
XmTextFindStringWcs(library call)