Search Results

Search: Posts Made By: gmark99
20,592
Posted By cbkihong
Did you really run my example? If you did, you...
Did you really run my example? If you did, you should find that the separators are in the array returned, and the output array is exactly what you indicated in your post. Verify it.
20,592
Posted By umen
hello and thanks for the fast reply This is...
hello and thanks for the fast reply
This is great solution I didn't know perl can take multiple patterns for separation
But one thing remains I also need to capture the patterns and put them into...
20,592
Posted By cbkihong
$, = "\n"; print split(/([-+*])/,...
$, = "\n";
print split(/([-+*])/, "foo1+foo22-blah*blah(var)+fooA(var)")';



foo1
+
foo22
-
blah
*
blah(var)
+
fooA(var)
20,592
Posted By umen
multiple pattern split in perl
Hello all
i have complex string that i will like to split to or to break to parts
my string is :
"foo1+foo22-blah*blah(var)+fooA(var)"
now i need to break this string so that every part of the...
4,776
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,776
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,776
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,776
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
4,776
Posted By dprakash
HI Pravin.. thanks for quick reply... i...
HI Pravin..
thanks for quick reply...
i executed your command...where im getting 3 xmls...
but ...</Order> tag is not coming in 2nd and 3rd xml ,but coming in 1st xml.
could you plz llook into...
4,776
Posted By pravin27
Try this, awk '/Order Number=\"/...
Try this,


awk '/Order Number=\"/ {a=$0;i=0;while(i<4){getline;a=a"\n"$0;++i};print a > ++j".xml"}' input.xml
4,776
Posted By dprakash
Need to Split Big XML into multiple xmls
Hi friends..
We have urgent requirement.We need to split the big xml having multiple orders into multiple xmls
having each order in each xml.
For Example
In input XMl will be in following format...
4,977
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
4,977
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...
6,553
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,553
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,553
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,553
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,553
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...
14,461
Posted By chakrapani
Xpath can be used like // till pattern ...
Xpath can be used like // till pattern ...
14,461
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...
90,008
Posted By Neo
User Guide: Posting in the Emergency Forum
Emergency UNIX and Linux Support !! Help Me! Forum (Request Urgent Help) (https://www.unix.com/emergency-unix-linux-support-help-me/)

README FIRST: How to Request Emergency or Urgent Help:


...
1,206
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,604
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,604
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,604
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
Showing results 1 to 25 of 33

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