10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Please, i'd like to extract string just before '.fr'.
Here is some lines of my file:
g-82.text.text1.fr.worker1
g-xx.yyyyyy.zzzz.fr.worker2
i'd like to extract this text:
g-82.text.text1
g-xx.yyyyyy.zzzz
Please, which command i have to use in my script shell ?
... (16 Replies)
Discussion started by: chercheur111
16 Replies
2. Shell Programming and Scripting
Hi All,
I have a log file in which name and version of applications are coming in the following format
name
It may look like following, based on the name of the application and version:
XYZ OR xyz OR XyZ OR xyz
I want to separate out the name and version and store them into variables.... (4 Replies)
Discussion started by: bhaskar_m
4 Replies
3. Shell Programming and Scripting
I would like to extract a digit from $0 starting 2,30 to 3,99 or 2.30 to 3.99
Can somebody fix this?
awk --re-interval '{if($0 ~ /{1}{2}/) {print FILENAME, substr($0,index($0,/{1}{2}/) , 4)}}'input
abcdefg sdlfkj 3,29 g. lasdfj
alsdfjasl 2.86 gr. slkjds sldkd
lskdjfsl sdfkj kdjlksj 3,34 g... (4 Replies)
Discussion started by: sdf
4 Replies
4. Shell Programming and Scripting
Hi,
I have an input string say for example:
ABC,DEF,IJK,LMN,...,XYZ
The above string is comma delimited. Now I have to extract the last part after the comma i.e. XYZ.
:b: (3 Replies)
Discussion started by: bghosh
3 Replies
5. Shell Programming and Scripting
Hi All,
i've a string
/u/asak/DATE/TEST_LOGS/20110704_033429_test11_w_2_120/HDD/test11_w_2_12/hd-120
i need to extract string which is test11_w_2_120, this can be start with anything, numbers, characters with underscore etc.. but the time stamp 20110704_033429_ with two underscores will be... (5 Replies)
Discussion started by: asak
5 Replies
6. Shell Programming and Scripting
Hi,
I'm a newbie to shell scripting and have searched the forum but couldn't find what i was looking for.
Basically I have a list of filenames like...
123-fileone.txt
I want to be able to extract the prefix up to the first '-'. So I'd end up with 123. I have attempted it using a pretty... (2 Replies)
Discussion started by: kirkg
2 Replies
7. Solaris
i have srtring i.e. "NAME,CLASS,AGE" (length of string is not constant) and from this string i've extract each word delimited by "," (comma).
INPUT: "NAME,CLASS,AGE"
OUTPUT: NAME
CLASS
AGE
how can i do that?
i have tried some string manipulation function like... (5 Replies)
Discussion started by: jadoo_c2
5 Replies
8. UNIX for Dummies Questions & Answers
I have a string:
hgLogOutput=" +0000 files: forum/web/hook-test.txt /forum/web/hook-test-2.txt description: test"
and I want to extract the file names from it, they will always appear between the files: and the description:. I have worked out that I can do this:
"$hgLogOutput" | awk '{... (2 Replies)
Discussion started by: klogger
2 Replies
9. Shell Programming and Scripting
please give me proper solution for finding a shortest substring from given string if string itself and first char and last char of that substr are also given by user
if S="dpoaoqooroo" and FC="o" and LC="o",then shortest substr is "oo" and rest of the string is "dpoaoqroo"
i have code but it is... (1 Reply)
Discussion started by: pankajd
1 Replies
10. Shell Programming and Scripting
I have a long string "<ID type="Oid">{}</ID>"
I need to extract "GigabitEthernet0/1" from the above string.
How can it be done? :) (5 Replies)
Discussion started by: girisha
5 Replies