You do know that with your requirements you'll get n^2 columns of output for any n columns of input (5 columns input -> 25 cols output, 1.000 input -> 1.000.000 output)
That aside, try if this fits you:
Exemplary output:
Last edited by pludi; 02-25-2010 at 12:50 PM..
Reason: typo
I have looked through the forums and found many date / time manipulation tools, but cannot seem to find something that fits my needs for the following.
I have a log file with date time stamps like this:
Jun 21 17:21:52
Jun 21 17:24:56
Jun 21 17:27:59
Jun 21 17:31:03
Jun 21 17:34:07
Jun... (0 Replies)
Hello,
I am in following situation.-
COUNT=`ls -l | wc -l`
echo $COUNT
---> 26
NO_OF_FILES=$COUNT-1
echo $NO_OF_FILES
---> 26-1
Here, I want the output to be 25. How could I do this. It seems simple, but I am not getting it. Please help me. (2 Replies)
hi all,
how do i subract variables in shell ?? am trying to space out the headers and the output generated by the shell so they all line up :
currently the output is like this :
servers : users
server1 : 10
latestServer : 50
so i thought... (3 Replies)
i have a small awk script which prints the 5 columns of different o/p i want the 5th column subtracted from 100 and then display the result .. but i do not get the desired result .. I 'm using following script
awk '
BEGIN {
FS=""
RS="us"
}
{
... (3 Replies)
Hi everyone, I had a similar question a couple days ago but my problem has gotten significantly (to me anyway) more complex.
I have two files:
File 1:
0808 166 166 62 9 0
1000fights 1 1 2 1 0
100places2visit 2 2 2 2 0
10veronica91 167 167 3 1 0
11thgorgeous 346 346 3806 1461 122... (2 Replies)
Legends,
Please help me in , how do i subtract the variable values listed like below.
the first value of orig should be subtracted from first value of prev and so on.
san> echo $orig
346 316 340 239 410 107 291 139 128 230 167 147 159 159 172 116 110 260 177 0 177 169 168 186 165 366 195... (15 Replies)
Hi,
I want to subtract 2 files and save the remaining text in another file. Lets say,
Hello
Happy //
Hi
*
Hungry
File2
Happy
Hi
Output
Hello (5 Replies)
Hi Folks,
I have a file with 2 columns TAB delimited and I want to add '1' to the first column and subtract '-1' from the second column.
What I have tried so far is;
awk -F"\t" '{ $1-=1;$2+=1}1' OFS='\t' file
File
0623 0623
0624 0624
0643 0643
1059 1037
1037 1037
1038 1038... (2 Replies)
Discussion started by: pshields1984
2 Replies
LEARN ABOUT DEBIAN
latex::encode
LaTeX::Encode(3pm) User Contributed Perl Documentation LaTeX::Encode(3pm)NAME
LaTeX::Encode - encode characters for LaTeX formatting
SYNOPSIS
use LaTeX::Encode;
$latex = latex_encode($text, %options);
VERSION
This manual page describes version 0.03 of the "LaTeX::Encode" module.
DESCRIPTION
This module provides a function to encode text that is to be formatted with LaTeX. It encodes characters that are special to LaTeX or that
are represented in LaTeX by LaTeX commands.
The special characters are: "" (command character), "{" (open group), "}" (end group), "&" (table column separator), "#" (parameter
specifier), "%" (comment character), "_" (subscript), "^" (superscript), "~" (non-breakable space), "$" (mathematics mode).
Note that some of the LaTeX commands for characters are defined in the LaTeX "textcomp" package. If your text includes such characters,
you will need to include the following lines in the preamble to your LaTeX document.
usepackage[T1]{fontenc}
usepackage{textcomp}
The function is useful for encoding data that is interpolated into LaTeX document templates, say with "Template::Plugin::Latex" (shameless
plug!).
SUBROUTINES /METHODS
"latex_encode($text, %options)"
Encodes the specified text such that it is suitable for processing with LaTeX. The behaviour of the filter is modified by the options:
"except"
Lists the characters that should be excluded from encoding. By default no special characters are excluded, but it may be useful to
specify "except = "\{}"" to allow the input string to contain LaTeX commands such as "this is \textbf{bold} text" (the doubled
backslashes in the strings represent Perl escapes, and will be evaluated to single backslashes).
"iquotes"
If true then single or double quotes around words will be changed to LaTeX single or double quotes; double quotes around a phrase
will be converted to "``" and "''" and single quotes to "`" and "'". This is sometimes called "intelligent quotes"
"use_textcomp"
By default the "latex_encode" filter will encode characters with the encodings provided by the "textcomp" LaTeX package (for
example the Pounds Sterling symbol is encoded as "\textsterling{}"). Setting "use_textcomp = 0" turns off these encodings. NOT
YET IMPLEMENTED
EXAMPLES
The following snippet shows how data from a database can be encoded and inserted into a LaTeX table, the source of which is generated with
"LaTeX::Table".
my $sth = $dbh->prepare('select col1, col2, col3 from table where $expr');
$sth->execute;
while (my $href = $sth->fetchrow_hashref) {
my @row;
foreach my $col (qw(col1 col2 col3)) {
push(@row, latex_encode($href->{$col}));
}
push @data, @row;
}
my $headings = [ [ 'Col1', 'Col2', 'Col3' ] ];
my $table = LaTeX::Table->new( { caption => 'My caption',
label => 'table:caption',
type => 'xtab',
header => $header,
data => @data } );
my $table_text = $table->generate_string;
Now $table_text can be interpolated into a LaTeX document template.
DIAGNOSTICS
None. You could probably break the "latex_encode" function by passing it an array reference as the options, but there are no checks for
that.
CONFIGURATION AND ENVIRONMENT
Not applicable.
DEPENDENCIES
The "HTML::Entities" and "Pod::LaTeX" modules were used for building the encoding table in "LaTeX::Encode::EncodingTable", but this is not
rebuilt at installation time. The "LaTeX::Driver" module is used for formatting the character encodings reference document.
INCOMPATIBILITIES
None known.
BUGS AND LIMITATIONS
Not all LaTeX special characters are included in the encoding tables (more may be added when I track down the definitions).
The "use_textcomp" option is not implemented.
AUTHOR
Andrew Ford <a.ford@ford-mason.co.uk>
LICENSE AND COPYRIGHT
Copyright (C) 2007 Andrew Ford. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
Template::Plugin::Latex
perl v5.10.0 2007-10-02 LaTeX::Encode(3pm)