"are you billy_smith ?"
replace with
"are you billy_smith ?
my name is billy_smith"
how to fetch the name "billy_smith" and using it later
I need sed script to do this, any one can help? Thanks (6 Replies)
A developer of mine has this requirement - I couldn't tell her quickly how to do it with UNIX commands or a quick script so she's writing a quick program to do it - but that got my curiousity up and thought I'd ask here for advice.
In a text file, there are some records (about half of them)... (4 Replies)
How can i user string or vector ins shared memory ?
For example i have a structure sharedInfo like below
struct sharedInfo {
string szName;
int iAge;
string szAddrees;
};
if i use this notation my program crashes. And if i use char szName, it work fine, what is wrong with... (4 Replies)
Hi,
I am using SunOS
I want to serch my previous command
from unix prompt
(like on AIX we can search by ESC -k)
how to get in SunOs
urgent help require. (10 Replies)
Basically I'm trying to avoid writing paragraphs to do it. It is possible I could convert over to a vector<int>'s if that may help. Does anyone know how to do this without really turning it into a huge brainbuster? I have considered using a for() loop but I wasn't able to put anything into practice... (1 Reply)
Hi All,
In continuation of my previous thread 'Add text at the end of line conditionally', I need to further modfiy the file after adding text at the end of the line. Now, I need to add a fixed charater string at alternate lines starting from first line using awk or sed.My file is now as below:... (10 Replies)
I have 2 files open in Vim at the same time.
I yank from one with
16yw
and get this
INSERT INTO ALIS_PART_MANU_PART_TAB (SEQUENCE_NO,PART_NO,MANU_NO,MANU_PART_NO,ROWVERSION) VALUES (
Now I go to the second file and type the command to add this to the beginning of every... (3 Replies)
I need to insert a comment string to a couple of fields for every line in the file. Different comment string for each field.
In below file, fields 7 and 8
"R","1","t0000684","","10/31/2013","10/31/2013","","","","750.23"... (6 Replies)
I need to read a text file and insert a string every n lines, but also have the line counter restart when I come across a header string.
Line repeating working every 3 lines using code:
sed '0~3 s/$/\nINSERT/g' < INPUT/PATH/FILE_NAME.txt > OUTPUT/PATH/FILE_NAME.txt
I cannot seem to find... (1 Reply)
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)
Discussion started by: tomislav91
13 Replies
LEARN ABOUT DEBIAN
statistics::basic::_onevectorbase
Statistics::Basic::_OneVectorBase(3pm) User Contributed Perl Documentation Statistics::Basic::_OneVectorBase(3pm)NAME
Statistics::Basic::_OneVectorBase - base class objects like Mean
METHODS
query()
Query the value of the object. It will return the undefined value until there's something to calculate (or until the vector is full
when nofill is in effect).
insert()
Insert new values into the vector.
$object_instance->insert( 4, 3 ); # insert a 3 and a 4
This function returns the object itself, for chaining purposes.
append() ginsert()
The growing insert inserts new elements, growing the max size of the vector to accommodate the new elements (if necessary).
$object_instance->ginsert( 4, 3 ); # append a 3 and a 4
This function returns the object itself, for chaining purposes.
query_size()
The current size of the vector -- regardless of its max size (as set by "set_size()").
query_vector()
Returns the Statistics::Basic::Vector object used by the computational object.
set_size()
Set the maximum size for the underlying Statistics::Basic::Vector object. This function requires one arguments.
Unless nofill is set, the vector will be filled with 0s (assuming the vector wouldn't otherwise be full) on the oldest side of the
vector (so an insert will push off one of the filled-zeros).
This function returns the object itself, for chaining purposes.
set_vector()
Given a vector or array ref, this will set the contents (and size) of the vector used for the object computations.
This function returns the object itself, for chaining purposes.
OVERLOADS
This class provides overloads. If evaluated as a string, it will attempt to print a pretty value for the object (or "n/a", see "query()"
above). the resulting string can be tuned, in terms of precision, see ipres for further information.
If evaluated as a number, it will try to return the raw result of "query()", possibly turning the resulting "undef" (if applicable) into a
0 in the process -- note that Perl does this 0-izing, not the overload.
The "eq" and "==" operators are also overloaded, trying to do the right thing. Also see toler for further information.
AUTHOR
Paul Miller "<jettero@cpan.org>"
COPYRIGHT
Copyright 2012 Paul Miller -- Licensed under the LGPL
SEE ALSO perl(1), Statistics::Basic, Statistics::Basic::Vector
perl v5.14.2 2012-01-23 Statistics::Basic::_OneVectorBase(3pm)