Welcome to forums, I hope you will enjoy learning and sharing knowledge here. Could you please try following and let me know if this helps you.
Output will be as follows.
Thanks,
R. Singh
Last edited by hicksd8; 04-26-2020 at 08:29 AM..
This User Gave Thanks to RavinderSingh13 For This Post:
I've been banging my head against the wall to accomplish the following. Given two files:
File a.txt
12345 hello
32324 there
File b.txt
12345 stuff
45454 howdy
32324 joe
If column 1 matches between the two files, then print only the entire line of the 2nd file (b.txt in this... (3 Replies)
I have this code to compare columns 1 and 10 between file1 and file 2 and give me all records that match column 1 but dont match column 10
However column 10 is date format mm/dd/yy and awk cant read it and compare ...i tried
awk < file1 -F~ '{print $10}'
and it gave blank screen
Is... (1 Reply)
Hello,
I am trying to redirect files to a directory by using a config file. The config files is as such:
xxxxxx,ID,PathToDirectory
xxxxxx,ID2,PathToDirectory2
and so on...
I have a variable that should match one of these IDs. I want to load this config file into an awk array, and... (2 Replies)
hi Friends
need to compare columns in one file where the data looks like below
laptop,IBM
phone,samsung
car,rental
user1,laptop
user2,laptop
user3,phone
want to get output as
laptop,IBM
phone,samsung
car,rental
user1,IBM
user2,IBM
user3,samsung
need to seach $2 in array of $1 and... (4 Replies)
Hi,
I know that this topic has been discussed in the past and I've tried to follow all the guidelines. Anyhow, I following describe my problem.
I have a file (file1 , no. records = 67) containing pairs of IP addresses as follows (with single space as delimiter between the fields):
example... (5 Replies)
Dear Unix experts,
I have got a file where I would like to compare the values of second column if first column is same in such a way that the difference between the values is >50. If not, I would like to discard both values.
For example, my input file looks like -
comp275_c0_seq2 73... (7 Replies)
So I have this issue. I have 4 files. the first one is the master file who has all possible combinations:
file 1
- a
- b
- c
- d
- e
the other three have some of the letters and a number instead of - for example
file 2
34 a
5 c
file 3
10 b
12 ... (3 Replies)
Hi,
0.23 2.94% 0.00 0.00% 17.8G 55.7% 19.6G 40.9% 630 0.00%
0.06 0.77% - - 7524M 22.9% 15.6G 32.6% - -
From the above sample output. I need to compare whether the 6th field is more than 10G..if so print the entire line. Here the 6th field is memory
TIA (5 Replies)
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Discussion started by: TestPractice
5 Replies
LEARN ABOUT DEBIAN
class::dbi::pager
Class::DBI::Pager(3pm) User Contributed Perl Documentation Class::DBI::Pager(3pm)NAME
Class::DBI::Pager - Pager utility for Class::DBI
SYNOPSIS
package CD;
use base qw(Class::DBI);
__PACKAGE__->set_db(...);
use Class::DBI::Pager; # just use it
# then, in client code!
package main;
use CD;
my $pager = CD->pager(20, 1); # ($items_per_page, $current_page)
my @disks = $pager->retrieve_all;
DESCRIPTION
Class::DBI::Pager is a plugin for Class::DBI, which glues Data::Page with Class::DBI. This module reduces your work a lot, for example when
you have to do something like:
* retrieve objects from a database
* display objects with 20 items per page
In addition, your work will be reduced more, when you use Template-Toolkit as your templating engine. See "EXAMPLE" for details.
EXAMPLE
# Controller: (MVC's C)
my $query = CGI->new;
my $template = Template->new;
my $pager = Film->pager(20, $query->param('page') || 1);
my $movies = $pager->retrieve_all;
$template->process($input, {
movies => $movies,
pager => $pager,
});
# View: (MVC's V)
Matched [% pager.total_entries %] items.
[% WHILE (movie = movies.next) %]
Title: [% movie.title | html %]
[% END %]
### navigation like: [1] [2] [3]
[% FOREACH num = [pager.first_page .. pager.last_page] %]
[% IF num == pager.current_page %][[% num %]]
[% ELSE %]<a href="display?page=[% num %]">[[% num %]]</a>[% END %]
[% END %]
### navigation like: prev 20 | next 20
[% IF pager.previous_page %]
<a href="display?page=[% pager.previous_page %]">
prev [% pager.entries_per_page %]</a> |
[% END %]
[% IF pager.next_page %]
<a href="display?page=[% pager.next_page %]">
next [% pager.entries_per_page %]</a>
[% END %]
NOTE / TODO
This modules internally retrieves itertors, then creates "Data::Page" object for paging utility. Using SQL clauses "LIMIT" and/or "OFFSET"
with "DBIx::Pager" might be more memory efficient.
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
Original idea by Tomohiro Ikebe <ikebe@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Class::DBI, Data::Page
perl v5.10.0 2006-03-01 Class::DBI::Pager(3pm)