Hi,
Here is my problem.. i have 2 files (file1, file2).. i have wrote the last two lines and first 4 lines of "file2" into two different variables .. say..
my $firstrec = `head -4 $file2`;
my $lastrec = `tail -2 $file2`;
and i write the rest of the file2 to a tmpfile and cat it with head... (2 Replies)
hello,
I have got the following problem that I am hoping someone can help with please.
1. I have got the following text file (below) , the columns data are
'Test Day', 'Board', 'Betting Number'.
TEXT FILE
============================================
1 3 02-01-27-28-29-30
0 1... (1 Reply)
Hello,
I have a problem which is giving me headache for days, can some please help. Please see code and text fiel below. Please see text in red for the problem I am facing
# Program gets an input x from user
while read line ; do
echo... (4 Replies)
I need to write value of variable $version at a particular line in a text file.
Line number is determined by another variable &line......I don't know how to do it in shell script ... (2 Replies)
Hello everyone,
I work under Ubuntu 11.10 (c-shell)
I need a script to create a new text file whose content is the text of another text files that are in the directory $DIRMAIL at this moment.
I will show you an example:
- On the one hand, there is a directory $DIRMAIL where there are... (1 Reply)
Hi,
I am an amateur bash scriptwriter and I need to write a script which creates a report in a formatted, easy to read table-like that is displayed to standard output. The script has to export the followings: Process ID,User Name, Command Name,Priority.....
Now I have a file that I can see all... (3 Replies)
Dear Friends,
I am in urgent need for awk/sed/sh script for converting a specific data format (.txt) to .xls.
The input is as follows:
>gi|1234|ref|
Query = 1 - 65, Target = 1677 - 1733
Score = 8.38, E = 0.6529, P = 0.0001513, GC = 46
fd sdfsdfsdfsdf
fsdfdsfdfdfdfdfdf... (6 Replies)
Hi,
I have a file(input.txt) and trying to format as output.txt. See the attached file format.
Note: This is a windows file (DOS format) and the commands are also going to execute on windows.
Basically I am trying to capture all the data in between Local Group Memberships and Global Group... (10 Replies)
I have looked through several threads regarding merging files with awk and attempted using join however have been unsuccessful likely as I do not fully understand awk.
What I am attempting is to take a csv file which could be between 1 and 15,000 lines with 5 colums and another csv file that will... (4 Replies)
Hello
I am facing a very unique problem and not able to understand why. I have written a function which will check header of the file. If header is present good else it will write the header on top
def writeHeaderOutputCSV(fileName):
# See if the file exist already
try:
... (0 Replies)
Discussion started by: radioactive9
0 Replies
LEARN ABOUT DEBIAN
data::phrasebook::loader::text
Data::Phrasebook::Loader::Text(3pm) User Contributed Perl Documentation Data::Phrasebook::Loader::Text(3pm)NAME
Data::Phrasebook::Loader::Text - Absract your phrases with plain text files.
SYNOPSIS
use Data::Phrasebook;
my $q = Data::Phrasebook->new(
class => 'Fnerk',
loader => 'Text',
file => 'phrases.txt',
);
# use default delimiters (:variable)
my $phrase = $q->fetch($keyword,{variable => 'substitute'});
# use Template Toolkit style delimiters
$q->delimiters( qr{ [% s* (w+) s* %] }x );
my $phrase = $q->fetch($keyword,{variable => 'substitute'});
DESCRIPTION
This loader plugin implements phrasebook patterns using plain text files.
Phrases can be contained within one or more dictionaries, with each phrase accessible via a unique key. Phrases may contain placeholders,
please see Data::Phrasebook for an explanation of how to use these. Groups of phrases are kept in a dictionary. In this implementation a
single file is one complete dictionary.
An example plain text file:
foo=Welcome to :my world. It is a nice :place.
Within the phrase text placeholders can be used, which are then replaced with the appropriate values once the get() method is called. The
default style of placeholders can be altered using the delimiters() method.
INHERITANCE
Data::Phrasebook::Loader::Text inherits from the base class Data::Phrasebook::Loader::Base. See that module for other available methods
and documentation.
METHODS
load
Given a "file", load it. "file" must contain a valid phrase map.
my $file = 'english.txt';
$loader->load( $file );
This method is used internally by Data::Phrasebook::Generic's "data" method, to initialise the data store.
To utilise the dictionary framework for a Plain Text phrasebook, the idea is to use a directory of files, where the directory is passed via
the "file" argument and the dictionary, the specific name of the file, is passed via the "dictionary" argument.
my $file = '/tmp/phrasebooks';
my $dictionary = 'english.txt';
$loader->load( $file, $dictionary );
get
Returns the phrase stored in the phrasebook, for a given keyword.
my $value = $loader->get( $key );
dicts
Having instantiated the "Data::Phrasebook" object class, and using the "file" attribute as a directory path, the object can return a list
of the current dictionaries available as:
my $pb = Data::Phrasebook->new(
loader => 'Text',
file => '/tmp/phrasebooks',
);
my @dicts = $pb->dicts;
or
my @dicts = $pb->dicts( $path );
keywords
Having instantiated the "Data::Phrasebook" object class, using the "file" and "dict" attributes as required, the object can return a list
of the current keywords available as:
my $pb = Data::Phrasebook->new(
loader => 'Text',
file => '/tmp/phrasebooks',
dict => 'TEST',
);
my @keywords = $pb->keywords;
or
my @keywords = $pb->keywords( $path, $dict );
Note that $path can either be the directory path, where $dict must be the specific file name of the dictionary, or the full path of the
dictionary file.
In the second instance, the function will not load a dictionary, but can be used to interrogate the contents of a known dictionary.
SEE ALSO
Data::Phrasebook.
SUPPORT
Please see the README file.
AUTHOR
Barbie, <barbie@cpan.org>
for Miss Barbell Productions <http://www.missbarbell.co.uk>.
COPYRIGHT AND LICENSE
Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
This module is free software; you can redistribute it and/or
modify it under the Artistic Licence v2.
perl v5.10.1 2010-08-31 Data::Phrasebook::Loader::Text(3pm)