Sponsored Content
Top Forums Shell Programming and Scripting How to put the command to remove duplicate lines in my awk script? Post 303037652 by Neo on Thursday 8th of August 2019 11:36:56 PM
Old 08-09-2019
I always do these types of tasks in PHP; but that's just me. We have a lot of AWK lovers here who will help with the AWK code.

My comment is only on the HTML:

Regarding the code above; my only comment is that, for the most part web developers most agree that <table> tags should be avoided and <div> tags should be used instead.

I have mostly eliminated all <table> tags here at unix.com, but there are still a few <table> tags here at unix.com from decades of legacy code I need to obsolete someday......
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to remove duplicate lines

I have following file content (3 fields each line): 23 888 10.0.0.1 dfh 787 10.0.0.2 dssf dgfas 10.0.0.3 dsgas dg 10.0.0.4 df dasa 10.0.0.5 df dag 10.0.0.5 dfd dfdas 10.0.0.5 dfd dfd 10.0.0.6 daf nfd 10.0.0.6 ... as can be seen, that the third field is ip address and sorted. but... (3 Replies)
Discussion started by: fredao
3 Replies

2. Shell Programming and Scripting

Command/Script to remove duplicate lines from the file?

Hello, Can anyone tell Command/Script to remove duplicate lines from the file? (2 Replies)
Discussion started by: Rahulpict
2 Replies

3. Shell Programming and Scripting

awk script to remove duplicate rows in line

i have the long file more than one ns and www and mx in the line like . i need the first ns record and first www and first mx from line . the records are seperated with tthe ; i am try ing in awk scripting not getiing the solution. ... (4 Replies)
Discussion started by: kiranmosarla
4 Replies

4. Shell Programming and Scripting

Command to remove duplicate lines with perl,sed,awk

Input: hello hello hello hello monkey donkey hello hello drink dance drink Output should be: hello hello monkey donkey drink dance (9 Replies)
Discussion started by: cola
9 Replies

5. Shell Programming and Scripting

remove duplicate lines using awk

Hi, I came to know that using awk '!x++' removes the duplicate lines. Can anyone please explain the above syntax. I want to understand how the above awk syntax removes the duplicates. Thanks in advance, sudvishw :confused: (7 Replies)
Discussion started by: sudvishw
7 Replies

6. Shell Programming and Scripting

Remove duplicate lines

Hi, I have a huge file which is about 50GB. There are many lines. The file format likes 21 rs885550 0 9887804 C C T C C C C C C C 21 rs210498 0 9928860 0 0 C C 0 0 0 0 0 0 21 rs303304 0 9941889 A A A A A A A A A A 22 rs303304 0 9941890 0 A A A A A A A A A The question is that there are a few... (4 Replies)
Discussion started by: zhshqzyc
4 Replies

7. Shell Programming and Scripting

[uniq + awk?] How to remove duplicate blocks of lines in files?

Hello again, I am wanting to remove all duplicate blocks of XML code in a file. This is an example: input: <string-array name="threeItems"> <item>item1</item> <item>item2</item> <item>item3</item> </string-array> <string-array name="twoItems"> <item>item1</item> <item>item2</item>... (19 Replies)
Discussion started by: raidzero
19 Replies

8. Shell Programming and Scripting

AWK Command to duplicate lines in a file?

Hi, I have a file with date in it like: UserString1 UserString2 UserString3 UserString4 UserString5 I need two entries for each line so it reads like UserString1 UserString1 UserString2 UserString2 etc. Can someone help me with the awk command please? Thanks (4 Replies)
Discussion started by: Grueben
4 Replies

9. Shell Programming and Scripting

Cant get awk 1liner to remove duplicate lines from Delimited file, get "event not found" error..help

Hi, I am on a Solaris8 machine If someone can help me with adjusting this awk 1 liner (turning it into a real awkscript) to get by this "event not found error" ...or Present Perl solution code that works for Perl5.8 in the csh shell ...that would be great. ****************** ... (3 Replies)
Discussion started by: andy b
3 Replies

10. Shell Programming and Scripting

How to remove duplicate lines?

Hi All, I am storing the result in the variable result_text using the below code. result_text=$(printf "$result_text\t\n$name") The result_text is having the below text. Which is having duplicate lines. file and time for the interval 03:30 - 03:45 file and time for the interval 03:30 - 03:45 ... (4 Replies)
Discussion started by: nalu
4 Replies
HTML::TagCloud(3pm)					User Contributed Perl Documentation				       HTML::TagCloud(3pm)

NAME
HTML::TagCloud - Generate An HTML Tag Cloud SYNOPSIS
# A cloud with tags that link to other web pages. my $cloud = HTML::TagCloud->new; $cloud->add($tag1, $url1, $count1); $cloud->add($tag2, $url2, $count2); $cloud->add($tag3, $url3, $count3); my $html = $cloud->html_and_css(50); # A cloud with tags that do not link to other web pages. my $cloud = HTML::TagCloud->new; $cloud->add_static($tag1, $count1); $cloud->add_static($tag2, $count2); $cloud->add_static($tag3, $count3); my $html = $cloud->html_and_css(50); # A cloud that is comprised of tags in multiple categories. my $cloud = HTML::TagCloud->new; $cloud->add($tag1, $url1, $count1, $category1); $cloud->add($tag2, $url2, $count2, $category2); $cloud->add($tag3, $url3, $count3, $category3); my $html = $cloud->html_and_css(50); # The same cloud without tags that link to other web pages. my $cloud = HTML::TagCloud->new; $cloud->add_static($tag1, $count1, $category1); $cloud->add_static($tag2, $count2, $category2); $cloud->add_static($tag3, $count3, $category3); my $html = $cloud->html_and_css(50); # Obtaining uncategorized HTML for a categorized tag cloud. my $html = $cloud->html_without_categories(); # Explicitly requesting categorized HTML. my $html = $cloud->html_with_categories(); DESCRIPTION
The HTML::TagCloud module enables you to generate "tag clouds" in HTML. Tag clouds serve as a textual way to visualize terms and topics that are used most frequently. The tags are sorted alphabetically and a larger font is used to indicate more frequent term usage. Example sites with tag clouds: <http://www.43things.com/>, <http://www.astray.com/recipes/> and <http://www.flickr.com/photos/tags/>. This module provides a simple interface to generating a CSS-based HTML tag cloud. You simply pass in a set of tags, their URL and their count. This module outputs stylesheet-based HTML. You may use the included CSS or use your own. CONSTRUCTOR
new The constructor takes a few optional arguments: my $cloud = HTML::TagCloud->new(levels=>10); if not provided, levels defaults to 24 my $cloud = HTML::TagCloud->new(distinguish_adjacent_tags=>1); If distinguish_adjacent_tags is true HTML::TagCloud will use different CSS classes for adjacent tags in order to be able to make it easier to distinguish adjacent multi-word tags. If not specified, this parameter defaults to a false value. my $cloud = HTML::TagCloud->new(categories=>@categories); If categories are provided then tags are grouped in separate divisions by category when the HTML fragment is generated. METHODS
add This module adds a tag into the cloud. You pass in the tag name, its URL and its count: $cloud->add($tag1, $url1, $count1); $cloud->add($tag2, $url2, $count2); $cloud->add($tag3, $url3, $count3); add_static This module adds a tag that does not link to another web page into the cloud. You pass in the tag name and its count: $cloud->add_static($tag1, $count1); $cloud->add_static($tag2, $count2); tags($limit) Returns a list of hashrefs representing each tag in the cloud, sorted by alphabet. Each tag has the following keys: name, count, url and level. css This returns the CSS that will format the HTML returned by the html() method with tags which have a high count as larger: my $css = $cloud->css; html($limit) This returns the tag cloud as HTML without the embedded CSS (you should use both css() and html() or simply the html_and_css() method). If any categories were specified when items were being placed in the cloud then the tags will be organized into divisions by category name. If a limit is provided, only the top $limit tags are in the cloud, otherwise all the tags are in the cloud: my $html = $cloud->html(200); html_with_categories($limit) This returns the tag cloud as HTML without the embedded CSS. The tags will be arranged into divisions by category. If a limit is provided, only the top $limit tags are in the cloud. Otherwise, all tags are in the cloud. html_without_categories($limit) This returns the tag cloud as HTML without the embedded CSS. The tags will not be grouped by category if this method is used to generate the HTML. html_and_css($limit) This returns the tag cloud as HTML with embedded CSS. If a limit is provided, only the top $limit tags are in the cloud, otherwise all the tags are in the cloud: my $html_and_css = $cloud->html_and_css(50); AUTHOR
Leon Brocard, "<acme@astray.com>". COPYRIGHT
Copyright (C) 2005-6, Leon Brocard This module is free software; you can redistribute it or modify it under the same terms as Perl itself. perl v5.12.3 2011-06-18 HTML::TagCloud(3pm)
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy