12-22-2008
Need your HELP:: Shell script to detect paragraph in coordinate-based code.
Hi Friends!!
I have obtained following output from a tool called pdftoxml:
<xml>
<text top="423" left="521" width="333" height="20" font="3">Although the the number of fuzzy rules of a system is </text>
<text top="441" left="500" width="355" height="20" font="3">directly dependant on these parameters. As the number of </text>
<text top="459" left="500" width="355" height="20" font="3">parameters increase, the number of fuzzy rules of the system </text>
<text top="477" left="500" width="125" height="20" font="3">grows exponentially.</text>
<text top="495" left="521" width="333" height="20" font="3">In fuzzy logic systems, there is a direct relationship </text>
<text top="513" left="500" width="355" height="20" font="3">between the number of fuzzy sets of input parameters of </text>
<text top="531" left="500" width="355" height="20" font="3">the system and the size of the fuzzy knowledge base (FKB). </text>
<text top="549" left="500" width="355" height="20" font="3">Kosko (1992) call this the "Curse of Dimensionallity." The </text>
<text top="567" left="500" width="355" height="20" font="3">"curse" in this instance is that there is exponential growth </text>
<text top="585" left="500" width="355" height="20" font="3">in the size of the fuzzy knowledge base (FKB), where <i>k</i> is </text>
<text top="603" left="500" width="355" height="20" font="3">the number of rules in the FKB, <i>m</i> is the number of fuzzy </text>
<text top="621" left="500" width="355" height="20" font="3">sets for each input and <i>n</i> is the number of inputs into the </text>
<text top="639" left="500" width="82" height="20" font="3">fuzzy system.
<text top="657" left="521" width="333" height="20" font="3">As the number of.....</text>
-----
-----
</text>
</xml>
Now, i want to write a script that detects paragraph in above code and enclose it within <P> tags.
Following condition should be used while detecting paragraphs.
"Paragraph starts when left=333 and ends as soon as it finds same value of left (i.e 333) again."
So, the FINAL OUTPUT should be as under:
<P>Although the the number of fuzzy rules of a system is directly dependant on these parameters. As the number of parameters increase, the number of fuzzy rules of the system grows exponentially.</P>
<P>In fuzzy logic systems, there is a direct relationship between the number of fuzzy sets of input parameters of the system and the size of the fuzzy knowledge base (FKB). Kosko (1992) call this the “Curse of Dimensionallity.” The “curse” in this instance is that there is exponential growth in the size of the fuzzy knowledge base (FKB), where k is the number of rules in the FKB, m is the number of fuzzy sets for each input and n is the number of inputs into the fuzzy system.</P>
------
----
Thanks a ton in advance!!!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i would like to ask how to make a script that in evry 3 lines of my paragraph(below) it would appear like this:
$ cat myparagraph
this is line 1
this is line 2
this is line3
this is line 4
this is 5
this 6
this is 7
this 8
====================================================
$ cat... (2 Replies)
Discussion started by: invinzin21
2 Replies
2. Shell Programming and Scripting
Hi All,
I want to run 5 `ps -ef | grep ` cmds in one script and i want the script to give me return code 0 if everything is OK. If it notices one of the processes is not there, it will prompt me the process name and advice me to check it.
I've wrote a script that separates the output but I want... (2 Replies)
Discussion started by: fara_aris
2 Replies
3. Shell Programming and Scripting
I am interested in finding out if there is a reliable and economical way for extracting user's location based on his ip address, using php
I tried to get the job done using ip2location.com, but I am not happy how it deals with result inconsistently. (2 Replies)
Discussion started by: siftin-com
2 Replies
4. Shell Programming and Scripting
I'm trying to read a bunch of log files and output the lines that contain particular strings.
To accomplish this, I've been running the following from the command line:
find . -name "*" | xargs grep " " | grep " " > output.txt
Two grep statements are needed in case I'm looking for a... (3 Replies)
Discussion started by: Rally_Point
3 Replies
5. Shell Programming and Scripting
Hello gurus,
I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script.
i m looking for something like this
call 3.1;
If 3.1 = "complete" then
call 3.2;
if 3.2 = ''COMPlete" then
call 3.3;
else
exit
The... (1 Reply)
Discussion started by: shashi369
1 Replies
6. Shell Programming and Scripting
I want to detect key pressed in my .cgi web page, but it does not work even I found the code in other web site.
My code is :
#!/bin/sh
#=================================================
# PATH defination
# ================================================... (2 Replies)
Discussion started by: Shuinvy
2 Replies
7. Shell Programming and Scripting
I have to check daily 20 processes each day. The names are like Network1 Network2 Network3 ....... Network20.
There is built in utility for doing this. Following is the command to check a single network process.
check_process_status 1
If we want to check the status of Network2 then the... (6 Replies)
Discussion started by: Nakul_sh
6 Replies
8. Shell Programming and Scripting
In the reference section of a research paper(in pdf form), many other paper names are cited which have been used inside the pdf at different places. If I give an input, the name of a paper which has been cited in the reference section and want to display the section (the paragraph) inside the pdf... (1 Reply)
Discussion started by: SK33
1 Replies
9. Shell Programming and Scripting
Hi All,
I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them
abc.sh
----------
export Numbr_Parms=$#
export a=1
while
do
export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
10. Shell Programming and Scripting
I wish to print my current shell which happens to be bash in my script check.sh
more check.sh
echo $0
echo `ps -p $$`
But instead of printing it prints check.sh i.e the name of the script for both the commands.
Can you please suggest how to print the current shell i m on inside the... (2 Replies)
Discussion started by: mohtashims
2 Replies
LEARN ABOUT CENTOS
cpanplus::shell
CPANPLUS::Shell(3) User Contributed Perl Documentation CPANPLUS::Shell(3)
NAME
CPANPLUS::Shell - base class for CPANPLUS shells
SYNOPSIS
use CPANPLUS::Shell; # load the shell indicated by your
# config -- defaults to
# CPANPLUS::Shell::Default
use CPANPLUS::Shell qw[Classic] # load CPANPLUS::Shell::Classic;
my $ui = CPANPLUS::Shell->new();
my $name = $ui->which; # Find out what shell you loaded
$ui->shell; # run the ui shell
DESCRIPTION
This module is the generic loading (and base class) for all "CPANPLUS" shells. Through this module you can load any installed "CPANPLUS"
shell.
Just about all the functionality is provided by the shell that you have loaded, and not by this class (which merely functions as a generic
loading class), so please consult the documentation of your shell of choice.
BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>.
AUTHOR
This module by Jos Boumans <kane@cpan.org>.
COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
SEE ALSO
CPANPLUS::Shell::Default, CPANPLUS::Shell::Classic, cpanp
perl v5.16.3 2013-05-20 CPANPLUS::Shell(3)