Extracting substring within string between 2 token within the string
Hello.
First best wishes for everybody.
here is the input file ("$INPUT1") contents :
This simple sed command works well for some kind of tokens.
These tokens work well
Which return :
Another working example
which return
Now I have another token2 of this kind : TOKEN2="local -a L_ARRAY"
And I got an error
I have tried to escape space and '-' without success
Any help is welcome
Ok, I'm stumped and can't seem to find relevant info.
(I'm not even sure, I might have asked something similar before.):
I'm trying to use shell scripting/UNIX commands to extract URLs from a fairly large web page, with a view to ultimately wrapping this in PHP with exec() and including the... (2 Replies)
Hi,
Need to extract a string from one file and search the same in other files.
Ex:
I have file1 of hundred lines with no delimiters not even space.
I have 3 more files.
I should get 1 to 10 characters say substring from each line of file1 and search that string in rest of the files and get... (1 Reply)
Hi All,
This is Ram. I'm new to this forum & new to shell scripts as well. I've a requirement in which I want to extract a substring from a given string based on last occurance of a character.
for eg.
I have a string of a file name with absolute path like... (2 Replies)
Hi ,
I have input file and i want to extract below strings
<msisdn xmlns="">0492001956</ msisdn> => numaber inside brackets
<resCode>3000</resCode> => 3000 needs to be extracted
<resMessage>Request time
getBalances_PSM.c(37): d out</resMessage></ns2:getBalancesResponse> => the word... (14 Replies)
Hi awk and sed gurus,
Please help me in the following.
I have the following entries in the file
ABCDErules
AbHDPrules
ABCrules
--
--
and other entries in the file.
Now, I want to extract from the file that contain entries for *rules and process it separately.
How can i do it... (6 Replies)
Hi,
I would like to extract a substring from a string in unix.
eg:
./checkfile.sh -- i need only checkfile.sh from this string.
Could someone help me out in this...
Regards
Arun (19 Replies)
Hi,
I am new to Unix. I am trying to extract a substring from an input string: Ex -
input string: deploy_v11_9_1
i want to extract and store the value v11_9_1 from the input string in a new variable.
I am using following command in my shell script file:
echo "Enter the folder name u... (5 Replies)
Discussion started by: Pranav Bhasker
5 Replies
LEARN ABOUT DEBIAN
ststrtok
ststring(3) ShapeTools Toolkit Library ststring(3)NAME
stConvertPattern, stSubstituteString, stStrtok, stStrEnter - string handling
SYNOPSIS
#include <config.h>
#include <sttk.h>
char* stConvertPattern (char *pattern);
char* stSubstituteString (char *original, char *old, char *new);
char* stStrtok (char *string);
char* stStrEnter (char *string);
DESCRIPTION
stConvertPattern converts sh(1) filename generation patterns to ed(1) string patterns.
question (?)
gets converted to period (.)
asterisk (*)
gets converted to a period followed by an asterisk (.*)
period (.)
will be escaped by a backslash character (.).
exclam (!)
gets converted to circumflex (^) if it follows an left bracket ([). Otherwise it remains unmodified.
The whole pattern will be enclosed in a circumflex (^) as leftmost an a dollar sign ($) as rightmost character.
stSubstituteString replaces all occurrences of substring old in original by string new. It returns a pointer to an allocated string that is
the result of this operation. Returns NULL if anything goes seriously wrong.
stStrtok considers the string string to consist of a sequence of zero or more text tokens separated by whitespace. The first call (with
pointer string specified) returns a pointer to the first character of the first token, and will have written a null character into string
immediately following the returned token. The function keeps track of its position between separate calls, so that subsequent calls (which
must be made with the string argument set to NULL) will work through the string immediately following that token. In this way subsequent
calls will work through the string until no tokens remain. When no token remains in string, a NULL pointer is returned.
stStrEnter adds the given string to an internal string table and returns a pointer to appropriate string table entry. Equal strings are
mapped to equal locations in the table. Equality of two strings in the string table can be checked by simple pointer comparison.
SEE ALSO
sh (1), ed (1)
sttk-1.7 Thu Jun 24 17:43:33 1993 ststring(3)