06-10-2008
Fantastic. That works a treat. I've not thought about using Perl before. Perhaps it's time I took a look at it!
Thanks for your help.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am having a problem executing a sed substitute in a file. I have tried alot of different things I found in previous posts, however non seem to work.
I want to substitute this in $FILE:
VALUE=33.4
In the script I have tried the following:
prev=$(awk -F"=" '{ print $2 }' $FILE )
new=$(echo... (16 Replies)
Discussion started by: newbreed1
16 Replies
2. Shell Programming and Scripting
I am trying to get rid of some ending tags but I run into some problems.
Ex.
How are you?</EndTag><Begin>It is fine.</Begin><New> Just about
I am trying to get rid of the ending tags, starts with </ and ending with >. (which is </EndTag> and </Begin>)
I tried the following
sed... (2 Replies)
Discussion started by: quixoticking11
2 Replies
3. UNIX for Dummies Questions & Answers
I'm using sed to perform a simply search and replace. The typical data is:
<fig><image href="Graphics/BAV.gif" align="left" placement="break"
I need to replace the value in the first set of quotes, keeping the remainder of the line the same. Thus:
<fig><image href="NEW_VALUE" align="left"... (3 Replies)
Discussion started by: Steve_altius
3 Replies
4. Shell Programming and Scripting
Hi All,
Here is what I'm trying to do with sed:
Input File:
somechangeVariable1=Something I would like to change
somechangeVariable2=Something else I would like to change
...
Output File:
somechangeVariable1=Something I would like to different
somechangeVariable2=Something else I would... (6 Replies)
Discussion started by: Peace_Dude1
6 Replies
5. Shell Programming and Scripting
I am having the following problem. I am having a lot of files (test_1_01.hea, test_1_02.hea, etc) with the content:
project_directory /net/1/d_1/5/
tmp_directory /net/1/d_1/5/
material_directory /net/1/d_1/5/
And I have to substitute the filepaths with new counted ones where the... (3 Replies)
Discussion started by: ergy1983
3 Replies
6. Shell Programming and Scripting
Is there a way to substitute the URL-encoding references of ( & and ` ) with their actual appearance? for example....
%26 is &
say I want to convert every %26 in my file to &.....
awk '{gsub(/%26/,"&");print}'
Is there a way to do this?
I also want to be able to convert ` too! (3 Replies)
Discussion started by: puttster
3 Replies
7. Shell Programming and Scripting
Hi ,
I have input file like below
Hi this is "vinoth".
Hi happy to work with 'unix'
USA(united states of America)
My script variables are below :
Dquote=Ộ
Squote=&#$567
Obrac=&^986
Cbrac=&^745
I want to read the variables in my SED command to replace the double quote,single... (9 Replies)
Discussion started by: vinothsekark
9 Replies
8. Shell Programming and Scripting
I am trying to do what I thought should be a simple substitution, but I can't get it to work.
File:
Desire output:
I thought I'd start with a sed command to remove the part of the header line preceding the string "comp", then go on to remove the suffix of the target string (e.g. ":3-509(-)"),... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
9. Shell Programming and Scripting
Dear all,
I try to replace a string of characters in a file (MyFile.txt) by a multiline value of the variable "Myvar":
$ cat MyFile.txt
DESCRIPTION '@TargetTable SCHEMA'
(
@InputFlowDef
);
$
The content of Myvar:
$ echo "$Myvar"
col1
, col2
, col3
$ (4 Replies)
Discussion started by: dae
4 Replies
10. UNIX for Beginners Questions & Answers
hi all,
i'd like to modify a file with sed , i want to substuite a char "-" with "/"
how can i do this?
Thanks for all
regards
Francesco (16 Replies)
Discussion started by: Francesco_IT
16 Replies
LEARN ABOUT DEBIAN
tm::objectable
TM::ObjectAble(3pm) User Contributed Perl Documentation TM::ObjectAble(3pm)
NAME
TM::Synchronizable - Topic Maps, trait for storing objects into backends
SYNOPSIS
my $tm = .... # get a topic map from somewhere
use Class::Trait;
Class::Trait->apply ($tm, "TM::ObjectAble");
my %store; # find yourself a proper store, can be anything HASHish
# append it to the list of stores, or ....
push @{ $tm->storages }, \%store;
# prepend it to the list of stores
unshift @{ $tm->storages }, \%store;
# store it (the proper storage will take it)
$tm->objectify ('tm:some-topic', "whatever object or data");
# get it back
my @objects = $tm->object ('tm:some-topic', 'tm:some-topic2');
# get rid of it
$tm->deobjectify ('tm:some-topic');
DESCRIPTION
This trait implements functionality to store arbitrary data on a per-topic basis.
Conceptually, the storage can be thought as one large hash, as keys being use the internal topic identifiers, as values the object data.
But to allow different topics to store their object data in different places, this interface works with a list of such hashes. Each hash
(native or tied to some implementation) in the list is visited (starting from the start of the list) and can take over the storage. Whether
this is based on the topic id, on some other topic information, or on the MIME type of the data (if it has one), is up to the
implementation to decide.
INTERFACE
Methods
storages
$listref = $tm->storages
This method returns an array reference. You can "unshift" or "push" your storage implementation onto this list.
Example:
my %store1;
push @{ $tm->storages }, \%store1
objectify
$tm->objectify ($tid => $some_data, ...);
This method stores actually the data. It takes a hash, with the topic id as keys and according values and tries to find for each of the
pairs an appropriate storage. If none can be found, it will raise an exception.
NOTE: Yes, this is a stupid name.
deobjectify
$tm->deobjectify ($tid, ...)
This method removes any data stored for the provided topic(s). If no data can be found in the appropriate storage, an exception will be
raised.
object
@objects = $tm->object ($tid, ...)
This method returns any data stored for the provided objects. If no data can be found for a particular topic, then "undef" will be
returned.
SEE ALSO
TM
AUTHOR INFORMATION
Copyright 20(10), Robert Barta <drrho@cpan.org>, All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://www.perl.com/perl/misc/Artistic.html
perl v5.10.1 2010-10-27 TM::ObjectAble(3pm)