Search Results

Search: Posts Made By: gmark99
14,931
Posted By chakrapani
Xpath can be used like // till pattern ...
Xpath can be used like // till pattern ...
14,931
Posted By chakrapani
Option for sel (select) is using xpath. ...
Option for sel (select) is using xpath.

What is Xpath ? May be you might get some basics from URL:
XPath Tutorial (http://www.w3schools.com/xsl/xpath_intro.asp)


bash-2.03$ xml
XMLStarlet...
1,237
Posted By Corona688
It'd probably be better to not proliferate...
It'd probably be better to not proliferate clutter that way.

How efficient the awk/grep method works depends on how large the files are, and how you're using them.
1,654
Posted By MadeInGermany
If different processes write to one file at a...
If different processes write to one file at a time, then there is a risk of file corruption (but not filesystem corruption). The corruption is usually that one of the concurrent writes is simply...
1,654
Posted By Don Cragun
You have been given two suggestions using set -C...
You have been given two suggestions using set -C or set -o noclobber that have nothing to do with mkdir. Have you looked at them?

I don't see how this has anything to do with the topic of this...
1,654
Posted By Corona688
I found it. It's a bash-only feature, mind. ...
I found it. It's a bash-only feature, mind.

set -o noclobber

if ! exec 5>filename
then
echo "Someone else already has filename" >&2
exit 1
fi

# things writing to FD 5
1,654
Posted By Corona688
There's an instant between 'check' and 'create...
There's an instant between 'check' and 'create file' when something else could create that file without bash knowing.

You could use mkdir. That's atomic. The first time it gets called it...
9,048
Posted By Don Cragun
It looks like it should work just fine (although...
It looks like it should work just fine (although it creates an unneeded process every time through the loop) if you want to completely ignore some command input read from your input file, never run...
9,048
Posted By sea
Was me, and i removed it because you already...
Was me, and i removed it because you already answered it but i had overseen.
Though, its not clear to me how it would identify which process to kill, as the file is just touched and you spawned...
9,048
Posted By wisecracker
Hi gmark99... <Cough> It would be wiser to...
Hi gmark99...

<Cough> It would be wiser to make your my_job have an error code in real time, detect it in the main script yet still log it as before...
How about commenting out the line, or...
9,048
Posted By DGPickett
There are ways to limit the number of parallel...
There are ways to limit the number of parallel processes for stable, robust system use; been there before, wrote bctl (birth control):...
9,048
Posted By Corona688
If you don't understand what's wrong, you also...
If you don't understand what's wrong, you also don't know what's relevant.

If you think the program is too big/complicated to post, whittle it down into a smaller, still-complete program which...
9,048
Posted By Don Cragun
So, from this code it seems that your intention...
So, from this code it seems that your intention is to simultaneously run an infinite number of jobs for every line in some file on your system. You do not care if any of these jobs start...
9,048
Posted By Don Cragun
There are thousands of things that could cause...
There are thousands of things that could cause this. SHOW US YOUR CODE!
6,738
Posted By Corona688
$ awk -F"\n" -v RS="" 'NR>1 && NF>1 { print...
$ awk -F"\n" -v RS="" 'NR>1 && NF>1 { print "<?xml version="1.0"?>\n<notification>\n", $0, "\n</notification>\n\n" > (NR-1)".xml" }' inputfile
6,738
Posted By summer_cherry
perl
local $/;
my $str = <DATA>;
my @arr = $str =~ /(<(\S+).*?<\/\2>)(?=.*school)/msg;
for(my $i=0;$i<=$#arr;$i=$i+2){
print '<?xml version="1.0"?>
<school>';
print "\n";
print $arr[$i],"\n";...
6,738
Posted By ganesan kulasek
HI Corona, Thanks for the reply. Please find...
HI Corona, Thanks for the reply.
Please find the below sample actual xml, in this below example i need to create 4 seperate xmls and update in a .xml file. I will get xml file with only in any of...
6,738
Posted By Corona688
I can make code that will work for that exact...
I can make code that will work for that exact file but will probably fail for your real application. So it'd be better off to see the actual data you want split in the first place, with confidential...
6,738
Posted By ganesan kulasek
Help required in Splitting a xml file into multiple and appending it in another .xml file
HI All,
I have to split a xml file into multiple xml files and append it in another .xml file. for example below is a sample xml and using shell script i have to split it into three xml files...
5,059
Posted By anurag.singh
awk -F'(>|<)' '/value1/,/value2/...
awk -F'(>|<)' '/value1/,/value2/ {if($2=="value1") v1=$3; else a[v1," ",$3]++}END{for (i in a) print i}' inputXML

For above input, output is:

xyx 123
568 zzzzz
5,059
Posted By unclecameron
big xml file with nested loop parse
I have an xml file with the structure:

<tag1>
<value1>xyx</value1>
<value2>123</value2>
</tag1>
<tag1>
<value1>568</value1>
<value2>zzzzz</value2>
</tag1>
where I...
4,839
Posted By danmero
awk 'NR==1{x=$0;next}/<\/Order>/{print y RS $0 RS...
awk 'NR==1{x=$0;next}/<\/Order>/{print y RS $0 RS "</OrderDetail>">f}/Order Number/{f="file"++n".xml";y=x}{y=y RS $0}' file.xml
4,839
Posted By pravin27
Try this Perl script-- parse.pl, ...
Try this Perl script-- parse.pl,


#!/usr/bin/perl

use strict;
my $ord_flg;
my $paymnt_flag;
my $str;

open (FH,"<","/path/to/ur/inputxmlfile") || die "can not open file\n";

while...
4,839
Posted By dprakash
thanks a lot pravin..its working..... ...
thanks a lot pravin..its working.....

---------- Post updated at 07:24 AM ---------- Previous update was at 06:38 AM ----------

Hi Pravin
we are not able to generate our real time Order xml...
4,839
Posted By pravin27
Its working fine at my end. try this, ...
Its working fine at my end.

try this,

awk '/Order Number=\"/ {a=$0;i=0;while(i<4){getline;a=a"\n"$0;i++};print a > ++j".xml"}' input.xml
Showing results 1 to 25 of 33

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