has anyone got any suggestions how i would pick up the string as part of a substitution inclusive of the carriage return.
ie
i want to pick up <<NAME>> from the PS output but the <<; seems to be on the line before the NAME.
Any ideas are appreciated!
... (3 Replies)
I am doing some edi where translations had to be run on unix. Generally when I run the translations on windows, the output file has both carriage returns and line feed where as when ran on unix will have only line feed. I need to insert carriage return before the line feed. Is there some tool... (2 Replies)
Hello everyone,
I am trying to search a file for lines that start with 'ip:' and have a carriage return after(ip:$). I then want to remove the carriage return from that line and append the next line in the file to the line containing 'ip'. I tried doing this with SED, but had no luck. Any... (3 Replies)
I am trying to generate some scripts to help manage an Oracle database. When I check the value returned from Oracle it has a leading carriage return in the variable. Is there a way to prevent this? Is there a way to easily strip out the carriage return. See code and output below.
... (7 Replies)
Hi all,
I'm reading a file with this layout:
First_Col Second_Col
The Second_Col has values as 1000, -1, 10, 43...
While reading the file I'm getting the second column value with awk command, but it is including the CR control char.
do
item_saved=`echo $b | awk '{print... (4 Replies)
Hi
I am using sed command to make SCORE=somevalue to SCORE=blank in a file.
Please see the attached lastline.txt file. After executing the below command on the file, it removes the last line.
cat lastline.txt | sed 's/SCORE=.*$/SCORE=/g' > newfile.txt
Why does sed command remove the... (3 Replies)
Hi experts,
Need your help on how to insert carriage return after the 10th char position of each line in a file and then add two blank spaces after the carriage return.
Example:
>cat test.txt
testingline
dummystring
samplesample
teststringline
Expected output should be..
... (2 Replies)
Hi,
I try to handle very large numbers with a bash script. I run ssh command in a remote server and store the output in a local variable. But this output contains a return carriage at the end. So I try to remove it by tr But I can't figure out the right notation with printf. So my problem... (6 Replies)
Hi,
I wish to know how to works the carriage return with cat.. As a picture often speaks better than words, my code below :
#te=`cat text.txt` (I tried this, but the same..)
te=$(cat text.txt)
echo $te
My file text.txt below:
BLABLABLABLABLALBLA
BLABLABLABLABLALBLA
... (9 Replies)
Discussion started by: Arnaudh78
9 Replies
LEARN ABOUT DEBIAN
wiki::toolkit::plugin::categoriser
Wiki::Toolkit::Plugin::Categoriser(3pm) User Contributed Perl Documentation Wiki::Toolkit::Plugin::Categoriser(3pm)NAME
Wiki::Toolkit::Plugin::Categoriser - Category management for Wiki::Toolkit.
DESCRIPTION
Uses node metadata to build a model of how nodes are related to each other in terms of categories.
SYNOPSIS
use Wiki::Toolkit;
use Wiki::Toolkit::Plugin::Categoriser;
my $wiki = Wiki::Toolkit->new( ... );
$wiki->write_node( "Red Lion", "nice beer", $checksum,
{ category => [ "Pubs", "Pub Food" ] }
) or die "Can't write node";
$wiki->write_node( "Holborn Station", "busy at peak times", $checksum,
{ category => "Tube Station" }
) or die "Can't write node";
my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new;
$wiki->register_plugin( plugin => $categoriser );
my $isa_pub = $categoriser->in_category( category => "Pubs",
node => "Red Lion" );
my @categories = $categoriser->categories( node => "Holborn Station" );
METHODS
new
my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new;
$wiki->register_plugin( plugin => $categoriser );
in_category
my $isa_pub = $categoriser->in_category( category => "Pubs",
node => "Red Lion" );
Returns true if the node is in the category, and false otherwise. Note that this is case-insensitive, so "Pubs" is the same category as
"pubs". I might do something to make it plural-insensitive at some point too.
subcategories
$wiki->write_node( "Category Pub Food", "mmm food", $checksum,
{ category => [ "Pubs", "Food", "Category" ] }
) or die "Can't write node";
my @subcats = $categoriser->subcategories( category => "Pubs" );
# will return ( "Pub Food" )
# Or if you prefer CamelCase node names:
$wiki->write_node( "CategoryPubFood", "mmm food", $checksum,
{ category => [ "Pubs", "Food", "Category" ] }
) or die "Can't write node";
my @subcats = $categoriser->subcategories( category => "Pubs" );
# will return ( "PubFood" )
To add a subcategory "Foo" to a given category "Bar", write a node called any one of "Foo", "Category Foo", or "CategoryFoo" with
metadata indicating that it's in categories "Bar" and "Category".
Yes, this pays specific attention to the Wiki convention of defining categories by prefacing the category name with "Category" and
creating a node by that name. If different behaviour is required we should probably implement it using an optional argument in the
constructor.
categories
my @cats = $categoriser->categories( node => "Holborn Station" );
Returns an array of category names in no particular order.
SEE ALSO
o Wiki::Toolkit
o Wiki::Toolkit::Plugin
AUTHOR
Kake Pugh (kake@earth.li). The Wiki::Toolkit team (http://www.wiki-toolkit.org/)
COPYRIGHT
Copyright (C) 2003-4 Kake Pugh. All Rights Reserved.
Copyright (C) 2006-2009 the Wiki::Toolkit team. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2009-10-25 Wiki::Toolkit::Plugin::Categoriser(3pm)