10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I have the following entries in a file:
Cause Indicators=80 90
Cause Indicators=80 90
Cause Indicators=82 90
Cause Indicators=82 90
Cause Indicators=82 90
The first 2 digits might change so I am after a sort of grep which could find any first 2 digits + the second 2,... (3 Replies)
Discussion started by: nms
3 Replies
2. Shell Programming and Scripting
I have a string like below
Note: I have have a single to any number of comma "," seperated string assigned to jdbc_trgt variable.
I need to split jdbc_trgt using comma(,) as the delimiter.
I tried the below but it fails as i dont know how can i read each split string iterately.
for... (4 Replies)
Discussion started by: mohtashims
4 Replies
3. Shell Programming and Scripting
Dear All,
My regex is like below. Its says all the number in coloum is include.
11666
11777
11888
^(?\: (0|11)(666|777|888))\\d+$
How to exclude all the numeric that not mentioned in above regex.
Regards, (3 Replies)
Discussion started by: tpx99
3 Replies
4. Shell Programming and Scripting
hi all,
Say i have a range like 0 - 1000 and i need to split into diffrent files the lines which are within a specific fixed sub-range. I can achieve this manually but is not scalable if the range increase.
E.g
cat file1.txt
Response time 2 ms
Response time 15 ms
Response time 101... (12 Replies)
Discussion started by: varu0612
12 Replies
5. Shell Programming and Scripting
Hi,
I would like to be able to parse out a substring matching a basic pattern, which is a character followed by 3 or 4 digits (for example S1234 out of a larger string). The main string would just be a filename, like Thisis__the FileName_S1234_ToParse.txt. The filename isn't fixed, but the... (2 Replies)
Discussion started by: keaneMB
2 Replies
6. Shell Programming and Scripting
Hello, let's say I have this string:
string1="A\nB\nC D E\nFG\nH";
How can I split it so as to take every string separated with '\n' separately?
For example, as for $string1, it would be split into
string1_part1="A"
string1_part2="B"
string1_part3="C D E"
string1_part4="FG"... (5 Replies)
Discussion started by: hakermania
5 Replies
7. Shell Programming and Scripting
Hi there, i wonder, is it possible to use regular expressions to partially select a string?
I have a bunch of server names which look like this
server1z-test
server2z2
server45z-primary
server13z3
I want to extract up to and including the 'z' in the server name, so for example
... (4 Replies)
Discussion started by: hcclnoodles
4 Replies
8. Shell Programming and Scripting
Hello all, I am having a problem with awk's string split function.
I have a string that has a number at the end, I am trying to remove the alpha portion of the string and just have the numeric part. Here is my code and the result:
BEGIN {
word = "$category121";
split(word, a, 121)
print... (2 Replies)
Discussion started by: RobertSubnet
2 Replies
9. UNIX for Dummies Questions & Answers
Hi :)
I am writing a ksh
I have a string of general format
A12B3456CD78
the string is of variable length
the string always ends with numbers (here it is 78.. it can be any number of digits may be 789 or just 7)
before these ending numbers are alphabets (here it is CD can even be... (3 Replies)
Discussion started by: lakshmikanth
3 Replies
10. Shell Programming and Scripting
how to match an alphanumeric string like the following.
i have to do like the following.
if the input line is
the data is {clock_91b}
i have to replace that with
the string was ("clock_91b")
i tried like
$line =~ s/the data is\s+\{(+)\}/the string was \(\"$1\"\)/
which... (4 Replies)
Discussion started by: sskb
4 Replies