I want to extract a string from a line in a text file between two different characters:
for example:
:string"
I want to extract string. It has to be done in a one-liner. (11 Replies)
Hi, guys. I have one question:
I need to search for a string in a file, and then extract another string from the file and assign it to a variable.
For example:
the contents of the file (group) is below:
...
ftp:x:23:
mail:x:34
...
testing:x:2001
sales:x:2002
development:x:2003
...... (6 Replies)
Hi Friends,
I have a script which returns me the following values line by line
ora_smon_RCAT102
oracleKHP102B (DESC
oraclePROOIDDB92 (DES
oraclePMS (DESCRIP
oracleBRIO (LOCAL=N
oracleBRIO (LOCAL=N
oraclePRDB92 (DES
oracleBRIO (LOCAL=N
oracleBRIO (LOCAL=N
oraclePMS (DESCRIP... (4 Replies)
How would I accomplish this if I want to test to see if it
1) starts with a dash so something like "-R"
AND
2) starts with 1 character then either a "-" or "+" and then up to 3 characters such as "a+rx" (3 Replies)
Hi,
I have a unix file with contents as below
Line1: ABC MNN X$$QWERTY$$ JKL
Line2: HELLO $$HOW$$ ARE $$YOU$$ DOING
i want to extract the string between $$ and $$ ie i want the output as QWERTY
HOW YOU
i want those strings seperated by some character say |
desired output is... (7 Replies)
Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed
Bold letters are the stations . The whole file has multiple stations .
Below example i wanted to search... (4 Replies)
Hi Team
I have an huge xml where i need to search for a ceratin numbers. For example
2014-05-06 15:15:41,498 INFO WebContainer : 10 CommonServicesLogs - CleansingTriggerService.invokeCleansingService Entered PUBSUB NOTIFY MESSAGE () -
<?xml version="1.0" encoding="UTF-8"... (5 Replies)
Hi,
I have a log file which is the output from a xml script :
<?xml version="1.0" ?>
<!DOCTYPE svc_result SYSTEM "MLP_SVC_RESULT_320.DTD">
<svc_result ver="3.2.0">
<slia ver="3.0.0">
<pos>
<msid type="MSISDN" enc="ASC">8093078040</msid>
<poserr>
... (4 Replies)
Hi All,
I am trying to extract only characters from a string value eg: abcdedg1234.cnf
How can I extract only characters abcdedg and assign to a variable.
Please help.
Thanks (2 Replies)
Discussion started by: abhi_123
2 Replies
LEARN ABOUT HPUX
basename
basename(1) General Commands Manual basename(1)NAME
basename, dirname - extract portions of path names
SYNOPSIS
string [suffix]
[string]
DESCRIPTION
deletes any prefix ending in and the suffix (if present in string) from string, and prints the result on the standard output. If string
consists entirely of slash characters, string is set to a single slash character. If there are any trailing slash characters in string,
they are removed. If the suffix operand is present but not identical to the characters remaining in string, but it is identical to a suf-
fix of the characters remaining in string, the suffix is removed from string. is normally used inside command substitution marks within
shell procedures.
delivers all but the last level of the path name in string. If string does not contain a directory component, returns indicating the cur-
rent working directory.
EXTERNAL INFLUENCES
Environment Variables
determines the interpretation of string and, in the case of basename, suffix as single and/or multi-byte characters.
If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari-
able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization
variable contains an invalid setting, and behave as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
EXAMPLES
The following shell script, invoked with the argument compiles the named file and moves the output to a file named in the current direc-
tory:
The following example sets the shell variable to
RETURN VALUE
and return one of the following values:
Successful completion.
Incorrect number of command-line arguments.
SEE ALSO expr(1), sh(1).
STANDARDS CONFORMANCE basename(1)