i have a file1 with many lines. i have a script that will let me input a string. for example, APPLE. what i need to do is to copy all lines from file1 where i can find APPLE or any string that i specify and paste in on file 2
thanks in advance! (4 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
I have a file1 with different with multiple fields and records
File2 has 2 fields.
I want to find and replace strings in file1 based on file2 values (I Want an exact match i.e. for example: when searching for DT:3, Substr of DT:34 should not be matched)
File2:
DT:3 foo_err
DT:34 bar_frr... (8 Replies)
Hello everyone,
I am comparing two floating point numbers by storing them in seperate files and then using difference command to verify,it is working fine.
But I want to compare two values which will come at 4 precision places.
ex:
file1
Date,Count,Checksum... (7 Replies)
Hi everyone,
I am new to Unix and need help writing a script that can ask user for an input, then search that input within a file
I know will have to use the read and grep commands, anyone can give me somewhere to start would help
Task: Write a script to display... (1 Reply)
Hi everyone,
I am new to Unix and need help writing a script that can ask user for an input, then search that input within a file
I know will have to use the read and grep commands, anyone can give me somewhere to start would help
Task: Write a script to display which volume pool a given... (1 Reply)
Hi Don, this is not homework question. I work for a Credit card company and my development goal this year is to learn Unix. I would love if others can help me get started, thanks.
Hi everyone
I am new to Unix and need help writing a script that can ask user for an input, then search that input... (2 Replies)
i am having file like this
#!/bin/bash
read -p 'Username: ' uservar
match='<color="red" />'
text='this is only a test
so please be patient
<color="red" />'
echo "$text" | sed "s/$match/&$uservar\g"
so desireble output what i want is if user type MARIA
this is only a test
so please... (13 Replies)
I am trying to read a value from a mapping file and would need to replace the value based on country parameter
source_table_@ctry_final
Expected
final_var=source_table_aus_final
If the country is in nz,usa,uk then
final_var=diff_table_nz_final
final_var=diff_table_usa_final
like that... (10 Replies)
Discussion started by: Master_Mind
10 Replies
LEARN ABOUT DEBIAN
cache::file::heap
Cache::File::Heap(3pm) User Contributed Perl Documentation Cache::File::Heap(3pm)NAME
Cache::File::Heap - A file based heap for use by Cache::File
SYNOPSIS
use Cache::File::Heap;
$heap = Cache::File::Heap->new('/path/to/some/heap/file');
$heap->add($key, $val);
($key, $val) = $heap->minimum;
($key, $val) = $heap->extract_minimum;
$heap->delete($key, $val);
DESCRIPTION
This module is a wrapper around a Berkeley DB using a btree structure to implement a heap. It is specifically for use by Cache::File for
storing expiry times (although with a bit of work it could be made more general).
See LIMITATIONS below.
CONSTRUCTOR
my $heap = Cache::File::Heap->new( [$dbfile] );
The heap constructor takes an optional argument which is the name of the database file to open. If specified, it will attempt to open the
database during construction. A new Cache::File::Heap blessed reference will be returned, or undef if the open failed.
METHODS
$h->open($dbfile)
Opens the specified database file.
$h->close()
Closes a previously opened heap database. Note that the database will be automatically closed when the heap reference is destroyed.
$h->add($key, $val)
Adds a key and value pair to the heap. Currently the key should be a number, whilst the value may be any scalar. Invokes 'die' on
failure (use eval to catch it).
$h->delete($key, $val)
Removes a key and value pair from the heap. Returns 1 if the pair was found and removed, or 0 otherwise.
($key, $val) = $h->minimum()
In list context, returns the smallest key and value pair from the heap. In scalar context only the key is returned. Note smallest is
defined via a numerical comparison (hence keys should always be numbers).
($key, $vals) = $h->minimum_dup()
In list context, returns the smallest key and an array reference containing all the values for that key from the heap. In scalar
context only the key is returned.
($key, $val) = $h->extract_minimum()
As for $h->minimum(), but the key and value pair is removed from the heap.
($key, $vals) = $h->extract_minimum_dup()
As for $h->minimum_dup(), but all the values are removed from the heap.
SEE ALSO
Cache::File
AUTHOR
Chris Leishman <chris@leishman.org>
Based on work by DeWitt Clinton <dewitt@unto.net>
COPYRIGHT
Copyright (C) 2003-2006 Chris Leishman. All Rights Reserved.
This module is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. This program is free software;
you can redistribute or modify it under the same terms as Perl itself.
$Id: Heap.pm,v 1.6 2006/01/31 15:23:58 caleishm Exp $
perl v5.12.4 2011-08-05 Cache::File::Heap(3pm)