Search Results

Search: Posts Made By: Siv51427882
1,825
Posted By RudiC
Yes. Remove the "," in the print statements or...
Yes. Remove the "," in the print statements or set OFS="".
1,825
Posted By RudiC
How about awk ' /<.?jms-system-resource>/ ...
How about
awk '
/<.?jms-system-resource>/ {JSR = /<j/
next
}

/<.?sub-deployment>/ {SDP = /<s/
...
2,440
Posted By RudiC
Now, this is different from what you requested in...
Now, this is different from what you requested in post#1, and it is not too clear to me what is actually requested. Given the .xml- file has EXACTLY the structure shown, how far would this get you?...
9,770
Posted By RavinderSingh13
Hello Siv51427882, I would like to request...
Hello Siv51427882,

I would like to request you to please open a NEW Thread for any new kind of questions because it may be confusing for people. Following may help you in same and let me know in...
9,770
Posted By RavinderSingh13
Hello Siv51427882, Sorry I forgot to remove...
Hello Siv51427882,

Sorry I forgot to remove ; in above, try following and let me know if this helps you.

awk -F"[><]" '
FNR==1{sub(/\..*/,"",FILENAME);file=FILENAME".properties"}...
9,770
Posted By RavinderSingh13
Hello Siv51427882, Could you please try...
Hello Siv51427882,

Could you please try following and let me know if this helps(Not tested it though).

awk -F"[><]" '
FNR==1{sub(/\..*/,"",FILENAME);file=FILENAME".properties"}...
9,770
Posted By Scrutinizer
Password hash anonymized in all posts. ...
Password hash anonymized in all posts.

Please anonymize relevant data before posting
9,770
Posted By Scott
Why don't you just post the "non-one liner" to...
Why don't you just post the "non-one liner" to start with?
9,770
Posted By RavinderSingh13
Hello Siv51427882, Could you please try...
Hello Siv51427882,

Could you please try following and let me know if this helps you.

awk -F"[><]" '/jdbc-data-source/{a=1} a && /<name>.*<\/name>/{print "Param1:-"$3;a="";next}...
9,770
Posted By Scrutinizer
Hi, try: awk ' $1~/jdbc-data-source / { ...
Hi, try:

awk '
$1~/jdbc-data-source / {
split($1,F,/"/)
name=F[2]
}
{
P[$1]=$2
}
END {
print name, P["url"], P["driver-name"], P["value"],...
9,770
Posted By RudiC
Sorry, no, it doesn't. Did you read and...
Sorry, no, it doesn't. Did you read and understand my entire post?
- Which of the samples is the valid one now - the one with the blank line in post#10, or the other ones in #8 and #12?...
9,770
Posted By RavinderSingh13
Hello Siv51427882, Could you please try...
Hello Siv51427882,

Could you please try following and let me know if this helps you.

awk -F"[><]" '/<\/jdbc-data-source>/{print "Param1:"param1 RS "Param2:"param2 RS "Param3:"param3 RS...
9,770
Posted By RavinderSingh13
Hello Siv51427882, Could you please try...
Hello Siv51427882,

Could you please try following and let me know if this helps you.

awk '
/<jdbc-system-resource>/{
non_flag=val="";
flag=1
}
/<\/jdbc-system-resource>/ && !non_flag{...
9,770
Posted By Yoda
Using python:- import xml.etree.ElementTree as...
Using python:-
import xml.etree.ElementTree as ET

tree = ET.parse('input.xml')

root = tree.getroot()

for jdbc in root.findall('jdbc-system-resource'):
name = jdbc.find('name').text
...
9,770
Posted By RavinderSingh13
Hello Siv51427882, Could you please try...
Hello Siv51427882,

Could you please try following and let me know if this helps you.

awk '/<jdbc-system-resource>/{non_flag=val="";flag=1} /<\/jdbc-system-resource>/ && !non_flag{print val RS...
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 11:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy