Sorry, I just noticed that the one-liner posted above will work only if, within the double-brackets:
(a) there's a single string with no embedded "|"s
(b) there are exactly two strings with exactly one embedded "|"
So, cases like the following:
will not be matched, and hence will not be altered by the script.
An example follows (I've modified your data a bit):
The fix for this is to modify the regex so that it:
(a) matches all characters, including "|"s, as much as possible
(b) matches a single "|" character (if it exists at all)
(c) matches the remainder that does not include "|", and set it to position 1
Something like this:
tyler_durden
This User Gave Thanks to durden_tyler For This Post:
Thats good Tyler. I had also tried only with a single | delimiter.
Thank you for correcting that. I am searching for a good perl xml parser package to develop my own wikipedia xml parser. Could you help me in this if you have some knowledge in perl xml parsers.
As i am new to perl i do not know about where to search the packages and all. Any help is appreciated.
Hello.
First best wishes for everybody.
here is the input file ("$INPUT1") contents :
BASH_FUNC_message_begin_script%%=() { local -a L_ARRAY;
BASH_FUNC_message_debug%%=() { local -a L_ARRAY;
BASH_FUNC_message_end_script%%=() { local -a L_ARRAY;
BASH_FUNC_message_error%%=() { local... (3 Replies)
I'm attempting to replace a substring that contains a hyphen and not having much success, can anyone point out where i'm going wrong or suggest an alternative.
# echo /var/lib/libvirt/images/vm888b-clone.qcow | sed -e 's|vm888-clone|qaz|g'
/var/lib/libvirt/images/vm888b-clone.qcow (1 Reply)
Hi, I have 2 statements in a file
a.sh start time is Fri Jan 9 17:17:33 CST 2015
a.sh end time is Fri Jan 9 17:47:33 CST 2015
I am required to get only the time out of it. like
17:17:33 & 17:47:33
PLs suggest (21 Replies)
Good morning friends,
how can i remove a string with linux scripting from a file? In specific i want to remove from a file all the tweet names and links
eg
@aerta and links such as http://dst.co/pIiu3i9c
Thanx!!! (4 Replies)
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)
Hi All,
Problem Description:
XML_REP_REQUEST=`CONCSUB "$LOGIN" "SQLAP" "$RESP_NAME" "$USRNM" WAIT="Y" "CONCURRENT" "APPLICATION_SHORT_NAME"
"CP_SHORT_NAME"`
echo Report Request: $XML_REP_REQUEST --to print value in log file
While execution the value of 'XML_REP_REQUEST' is 'Prozess... (5 Replies)
hi all,
I am trying to extract SUBSTRINGS out of a string using ksh.
The string is "SAPR3K.FD0.FA.TJ.B0010.T050302"
I tried using
a= `expr substr $stringZ 1 2`
which is giving me a syntax error, donno why??
any ideas why its not working??
I also tried
echo "welcome" | awk '{... (3 Replies)