01-29-2007
how to find substring position in a given string
Hello,
I have a string like
str = "14: Jan 29 13:27:12 : Processor----: [Thread:35]: 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. sometimes the same string will be like " operation: [CLEANUP] parameter: [23185980] 15: Jan 29 13:51:37 : Processor---: [Thread:3]: task commit"
If i get the position of "Processor", i can go back and get the date always..
anybody pls help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
... (1 Reply)
Discussion started by: naveenkcl
1 Replies
2. 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
3. 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
4. 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
5. Shell Programming and Scripting
Hi
I want to use korn shell.
I have files in a directory of following format
abc01of09xyz
abc02of09mno
aabc03of09qrs
---
--
requirement first is to check if any files of format "abc*of*" exists. If yes then match the number of such files with the number mentioned in each files(09 in... (1 Reply)
Discussion started by: subusona
1 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 gurus,
I am trying to figure out how to extract substring from file line (all lines in file), as specified position and specified legth.
Example input (file lines)
dhaskjdsa dsadhkjsa dhsakjdsad hsadkjh
dsahjdksahdsad sahkjd sahdkjsahd sajkdh adhjsak
I want to extract substring on... (5 Replies)
Discussion started by: ProsteJa
5 Replies
8. 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
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
dms(8) System Manager's Manual dms(8)
Name
dms - diskless management services utility
Syntax
/etc/dms
Description
The utility performs diskless management services. You can use to install products into diskless management services areas on a server
machine and register diskless clients so that they can access those products on the server machine, rather than having each client install
the products to a disk on its local machine. The server machine can be either a VAX or a RISC machine and it can serve both VAX and RISC
clients.
Before you set up a diskless management services area on a server, the following software should be installed: Local Area Network (LAN);
Network File System (NFS); and Maintenance Operations Protocol (MOP).
The utility performs the following functions:
a - Add Client Processor
m - Modify Client Parameters
r - Remove Client Processor
l - List Registered Clients
s - Show Products in Diskless Environments
i - Install Software
c - Create Diskless Area on Disk
k - Kernel Rebuild or Copy
To set up a diskless management services area on a server, select functions in the following order:
1. Create Diskless Area on Disk (c)
This sets up the disk partitions needed for the two diskless management services file systems, and (The question mark (?) represents
a unique number assigned by The file system contains a common root area that is copied to each client when it is registered, and a
area that is shared by all the clients. The file system contains a copy of the common root area for each registered diskless
client.
2. Install Software (i)
This installs the products from the distribution media to the file system. If the product will be accessed by VAX clients, the
images from the media are put under a directory under the file system. If the product will be accessed by RISC clients, the images
from the media will be put under a directory under the file system. The question mark (?) represents a unique number assigned by
To register a diskless client, select the Add Client Processor option (a). This copies the common root area in the file system, for exam-
ple, to the diskless client's directory in the file system, for example, The server's file is updated to allow the client to access its
individual root and the shared area.
Each diskless client's area also contains a client parameter file,
You must use interactively to set up a diskless environment or to modify client parameters.
There are several functions you can use either interactively or from the command line:
- Add Client Processor
- Show Products in Diskless Environments
- Remove Client Processor
- Kernel Rebuild
When the first diskless client is registered for a diskless management services area, a database file, is created on the server machine.
You can use this file and the command line to manage groups of diskless clients.
Files
See Also
exports(5nfs), addnode(8), setld(8)
Guide to Diskless Management Services
Guide to Server Setup
dms(8)