Sponsored Content
Top Forums Shell Programming and Scripting Sort html based on .jar, .war file names and still keep text within three groups. Post 302968667 by kchinnam on Saturday 12th of March 2016 09:19:47 PM
Old 03-12-2016
Sort html based on .jar, .war file names and still keep text within three groups.

Output from zipdiff GNU EAR comparison tool produces output in html divided into three sections "Added, Removed, Changed". I want the output to be sorted by jar or war file.


Code:
<html>
<body>
<table>
<tr>
<td class="diffs" colspan="2">Added </td>
</tr>
<tr><td>
<ul>
<li>jar1.jar/com/aaa/bbbb/cc/file1.class</li>
<li>jar1.jar/com/aaa/bbbb/cc/file3.class</li>
<li>jarname.jar/com/aaa/bbbb/cc/dd/filename.class</li>
<li>jarname.jar/com/aaa/bbbb/cc/ee/af/fileblala.class</li>
</ul>
<tr>
<td class="diffs" colspan="2">Removed </td>
</tr>
<tr><td>
<ul>
<li>jar3.war/com/aaa/bbbb/cc/file5.class</li>
<li>jarbla.jar/com/aaa/bbbb/cc/file6.class</li>
<li>jarblabla.war/com/aaa/bbbb/cc/ee/fa/afd/filenamefa.class</li>
<li>jar3.war/com/aaa/bbbb/cc/affa/faf/wrw/filenaa.class</li>
</ul>
<tr>
<td class="diffs" colspan="2">chagned </td>
</tr>
<ul>
<tr><td>
<li>jar4.jar/com/aaa/bbbb/cc/filefsaf.class</li>
<li>jarfsadf.war/com/aaa/bbbb/cc/filedfasf.class</li>
<li>jar4.jar/com/aaa/bbbb/cc/file11.class</li>
<li>jardfasdf.war/com/aaa/bbbb/cc/rr/ryy/filedfasf.class</li>
</ul>
</td>
</tr>
</table>

Expected output will have sorted by .jar and .war file names under sections
"Added, Removed, Updated". I think awk or sed can do this with inline replacing.

Code:
<html>
<body>
<table>
<tr>
<td class="diffs" colspan="2">Added </td>
</tr>
<tr><td>
<ul>
<li>jar1.jar/com/aaa/bbbb/cc/file1.class</li>
<li>jar1.jar/com/aaa/bbbb/cc/file3.class</li>
<li>jarname.jar/com/aaa/bbbb/cc/dd/filename.class</li>
<li>jarname.war/com/aaa/bbbb/cc/ee/af/fileblala.class</li>
</ul>
<tr>
<td class="diffs" colspan="2">Removed </td>
</tr>
<tr><td>
<ul>
<li>jar3.war/com/aaa/bbbb/cc/file5.class</li>
<li>jar3.war/com/aaa/bbbb/cc/affa/faf/wrw/filenaa.class</li>
<li>jarbla.jar/com/aaa/bbbb/cc/file6.class</li>
<li>jarblabla.war/com/aaa/bbbb/cc/ee/fa/afd/filenamefa.class</li>
</ul>
<tr>
<td class="diffs" colspan="2">chagned </td>
</tr>
<ul>
<tr><td>
<li>jar4.jar/com/aaa/bbbb/cc/filefsaf.class</li>
<li>jar4.jar/com/aaa/bbbb/cc/file11.class</li>
<li>jarfsadf.war/com/aaa/bbbb/cc/filedfasf.class</li>
<li>jardfasdf.war/com/aaa/bbbb/cc/rr/ryy/filedfasf.class</li>
</ul>
</td>
</tr>
</table>


Last edited by kchinnam; 03-13-2016 at 07:21 PM.. Reason: corrected input
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I extract text only from html file without HTML tag

I have a html file called myfile. If I simply put "cat myfile.html" in UNIX, it shows all the html tags like <a href=r/26><img src="http://www>. But I want to extract only text part. Same problem happens in "type" command in MS-DOS. I know you can do it by opening it in Internet Explorer,... (4 Replies)
Discussion started by: los111
4 Replies

2. UNIX for Dummies Questions & Answers

How can I sort the file names in the directory

Hi , I have a list of files in the directory I want to sort based on the file name. But in the middle of filename contains the number based on that I need to sort.Could you suggest me on the same? Example filenames: /user1$ls RS.DEV.ISV.F1.RS.REFDATA.DATA... (1 Reply)
Discussion started by: praveen.thumati
1 Replies

3. Shell Programming and Scripting

Find and rename long file names (html)

Hi Guys, I need a help. I have 1130 zip files. Each one of them has files including 1 html file with long file name (includes special charactors, Alphabetic and numbers). I have copied all 1130 zip files to my linux system and extracted using below command. Find . -name "*.zip" -exec... (7 Replies)
Discussion started by: Rajmani
7 Replies

4. Shell Programming and Scripting

Sort content of text file based on date?

I now have a 230,000+ lines long text file formatted in segments like this: Is there a way to sort this file to have everything in chronological order, based on the date and time in the text? In this example, I would like the result to be: (19 Replies)
Discussion started by: KidCactus
19 Replies

5. UNIX for Dummies Questions & Answers

gawk asort to sort record groups based on one subfield

input ("/" delimited fields): style1/book1 (author_C)/editor1/2000 style1/book2 (author_A)/editor2/2004 style1/book3 (author_B)/editor3/2001 style2/book8 (author_B)/editor4/2010 style2/book5 (author_A)/editor2/1998 Records with same field 1 belong to the same group. Using asort (not sort),... (3 Replies)
Discussion started by: lucasvs
3 Replies

6. Web Development

Sort 3 or more columns in a HTML file

Hi Friends, I have a HTMl file with 10 columns. I found a script online that can sort any single column in a HTML file. But, I would like to sort on multiple columns at once. Could you please show some pointers? Thanks (6 Replies)
Discussion started by: jacobs.smith
6 Replies

7. Shell Programming and Scripting

How to get CRC check sum of files in java EAR file without extracting .jar/.war files to disk.?

unzip -v gives CRC info of each file in a zip(in my case .EAR) file. # unzip -v my-application.ear Archive: my-application.ear Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 197981 Defl:N 183708 7%... (1 Reply)
Discussion started by: kchinnam
1 Replies

8. Shell Programming and Scripting

Best way to sort file with groups of text of 4-5 lines by the first one

Hi, I have some data I have taken from the internet in the following scheme: name direction webpage phone number open hours menu url book url name ... Of course the only line that is mandatory is the name wich is the one I want to sort by. I have the following sed & awk script that... (3 Replies)
Discussion started by: devmsv
3 Replies

9. UNIX for Beginners Questions & Answers

Sort a text file based on names in square brackets

Hi all, I have a text file similar to this: Text More text Etc Stuff That Is Needed Etc Etc This contains over 70 entries and each entry has several lines of text below the name in square brackets. (5 Replies)
Discussion started by: Scally
5 Replies
JH_MANIFEST(1)							    Javahelper							    JH_MANIFEST(1)

NAME
jh_manifest - Adds or/and modifies manifests for jars SYNOPSIS
jh_manifest [debhelperoptions] [options] jar1 ... jarN jh_manifest [debhelperoptions] [options] DESCRIPTION
Javahelper tool to add or update manifests in a jar file. It can be used in two modes. If passed jar files, it will only process these jar files. Otherwise it will update all jar files in the packages it acts on. When processing a package, the debhelper(7) exclude option will make jh_manifest ignore matching jar files. FILES
debian/package.manifest (or debian/manifest) This file consist of a list of jar files and values to add to their manifests. Values in this file will take precedence over values in the original manifest (and command line arguments over values in this file). It is allowed to list a link in this file instead of an actual jar file, provided that the link can be resolved when jh_manifest processes it. If a jar file is listed here cannot be found, jh_manifest will print a warning, unless the jar file has been excluded. As of javahelper >= 0.32, you may add comments in this file. If the line starts with a "#" it is completely ignored. This file is ignored if jh_manifest is passed jar files via command line. OPTIONS
-c classpath, --classpath=classpath Sets the Class-Path attribute of all processed jar files to classpath. If not passed, then the CLASSPATH environment variable will be used in the given jar file do not have a Class-Path attribute. -m class, --main=class Sets the Main-Class attribute to class in all processed jar files. -o options, --javaopts=options Sets the Debian-Java-Parameters to options in all processed jar files. This attribute is used by jarwrapper to start java with extra options (e.g. to make more memory available). -j /path/to/java/home, --java-home=/path/to/java/home Sets the Debian-Java-Home attribute to /path/to/java/home in all processed jars. This attribute is used by jarwrapper to determine which JVM to use. EXAMPLES
An example debian/manifest file: # use the symlink so we do not have to update with the next upstream release. usr/share/java/my.jar: Class-Path: dep1.jar dep2.jar Main-Class: some.awesome.Class usr/share/java/dep2.jar: Class-Path: dep1.jar SEE ALSO
debhelper(7) This program is a part of javahelper and uses debhelper as backend. There are also tutorials in /usr/share/doc/javahelper. AUTHOR
Niels Thykier <niels@thykier.net> COPYRIGHT AND LICENSE
Copyright 2010 by Niels Thykier This tool is free software; you may redistribute it and/or modify it under the terms of GNU GPL 2. 0.43 2012-03-12 JH_MANIFEST(1)
All times are GMT -4. The time now is 04:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy