09-11-2017
thanks a lot .. really helpful information
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I would like to compare file1 and file2
file1
1
2
3
file2
1 a
2 b
3 c
4 d
The result should only print out "d" in file 2.
Thanks (3 Replies)
Discussion started by: phamp008
3 Replies
2. Shell Programming and Scripting
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)
Discussion started by: tiggyboo
3 Replies
3. Shell Programming and Scripting
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)
Discussion started by: sigh2010
1 Replies
4. Shell Programming and Scripting
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)
Discussion started by: jrfiol
2 Replies
5. Shell Programming and Scripting
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)
Discussion started by: arun1401
4 Replies
6. Shell Programming and Scripting
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)
Discussion started by: amarn
5 Replies
7. Shell Programming and Scripting
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)
Discussion started by: utritala
7 Replies
8. UNIX for Dummies Questions & Answers
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)
Discussion started by: Quijotes
3 Replies
9. Shell Programming and Scripting
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)
Discussion started by: Sumanthsv
5 Replies
10. Shell Programming and Scripting
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
data::printer::filter::db
Data::Printer::Filter::DB(3pm) User Contributed Perl Documentation Data::Printer::Filter::DB(3pm)
NAME
Data::Printer::Filter::DB - pretty printing database objects
SYNOPSIS
In your program:
use Data::Printer filters => {
-external => [ 'DB' ],
};
or, in your ".dataprinter" file:
{
filters => {
-external => [ 'DB' ],
};
DESCRIPTION
This is a filter plugin for Data::Printer. It filters through DBI's handlers (dbh) and statement (sth) objects displaying relevant
information for the user.
DBI is an extremely powerful and complete database interface. But it does a lot of magic under the hood, making their objects somewhat
harder to debug. This filter aims to fix that :)
For instance, say you want to debug something like this:
use DBI;
my $dbh = DBI->connect('dbi:DBM(RaiseError=1):', undef, undef );
A regular Data::Dumper output gives you absolutely nothing:
$VAR1 = bless( {}, 'DBI::db' );
Data::Printer makes it better, but only to debug the class itself, not helpful at all to see its contents and debug your own code:
DBI::db {
Parents DBI::common
Linear @ISA DBI::db, DBI::common
public methods(48) : begin_work, clone, column_info, commit, connected, data_sources, disconnect, do, foreign_key_info, get_info, last_insert_id, ping, prepare, prepare_cached, preparse, primary_key, primary_key_info, quote, quote_identifier, rollback, rows, selectall_arrayref, selectall_hashref, selectcol_arrayref, selectrow_array, selectrow_arrayref, selectrow_hashref, sqlite_backup_from_file, sqlite_backup_to_file, sqlite_busy_timeout, sqlite_collation_needed, sqlite_commit_hook, sqlite_create_aggregate, sqlite_create_collation, sqlite_create_function, sqlite_enable_load_extension, sqlite_last_insert_rowid, sqlite_progress_handler, sqlite_register_fts3_perl_tokenizer, sqlite_rollback_hook, sqlite_set_authorizer, sqlite_update_hook, statistics_info, table_info, tables, take_imp_data, type_info, type_info_all
private methods(0)
internals: {
}
}
Fear no more! If you use this filter, here's what you'll see:
SQLite Database Handle (connected) {
dbname: file.db
Auto Commit: 1
Statement Handles: 0
Last Statement: -
}
Much better, huh? :)
Statement handlers are even better. Imagine you continued your code with something like:
my $sth = $dbh->prepare('SELECT * FROM foo WHERE bar = ?');
$sth->execute(42);
With this filter, instead of an empty dump or full method information, you'll get exactly what you came for:
SELECT * FROM foo WHERE bar = ? (42)
Note that if your driver does not support holding of parameter values, you'll get a "bindings unavailable" message instead of the bound
values.
SEE ALSO
Data::Printer
perl v5.14.2 2011-05-30 Data::Printer::Filter::DB(3pm)