It sounds so easy to do.
I have a file thats laid out like this..
number text text text text (etc about 15 times with various text fields)
I want to take the first field, "number", subtract 100 from it, and then put it back in the file. a simple little manipulation of the first field in... (4 Replies)
Hi all-
I've got a file that will have multiple columns. In one column there will be a string that is 10 digits in length, but I need to trim the first four zeros to make it 6 characters?
example:
0000001234
0000123456
0000234566
0000000321
output:
001234
123456
234566
000321 (5 Replies)
Hi People,
I need some Help to write a unix script that asks for a sentence to be typed out then with the sentence. Counts the number of spaces within the sentence and then echo's out "The Number Of Spaces In The Sentence is 4" as a example
Thanks
Danielle (12 Replies)
Hello All ,
i am a newbie in korn shell scripting trying to trim a sentence that is parsed into a variable . The format of the sentence has three words that are separated from other by a
" : " colon and "." period . Format of the sentence looks like
... (5 Replies)
Hi,
There's a long sentence from which I need to extract only the part which is at the right side of the word LENGTH i.e. 15
long sentence :
<INPUT VAR1 ="" DATATYPE ="number(p,s)" VAR2 ="" VAR3 ="3" VAR4="0" VAR5 ="ELEMITEM" VAR6 ="NO" VAR7 ="NOT A KEY" VAR8 ="17" LEVEL ="0" NAME... (3 Replies)
$SET_PARAMS='-param Run_Type_Parm=Month -param Portfolio_Parm="997" -param From_Date_Parm="2011-08-09"'
Want to extract the value of "Portfolio_Parm" from $SET_PARAMS i.e in the above case "997" & assigned to new variable.
The existence order of "Portfolio"Parm" can change, but the name... (2 Replies)
How do I use multiple field separators in awk?
I know that if I use awk -F"", both a and b will be field separators. But what if I need two field separators that both are longer than one letter?
If I want the field separators to be "ab" and "cd", I will not be able to use awk -F"". The ... (2 Replies)
Hi
I have two text files. The first file is TEXTFILEONE.txt as given below:
<Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text>
<Text Text_ID="10155645315851111_10155645317023456"... (7 Replies)
Hello All,
I have a file with details such as below. How do i extract only the
host and port ?
eg: dbs.ads.com 1521
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbs.ads.com)(PORT=1521))(CONNECT_DATA=(SID=vug)))... (5 Replies)
I am having hard time with this sql:
select partition_name, high_value
FROM user_tab_partitions
WHERE table_name = 'WNP_TPRESPONSE_INSTANCE'
and to_char(high_value) <= to_char(sysdate - 15, 'yyyymm')
;
I get an error: ORA-00932: inconsistent datatypes: expected CHAR got LONG... (1 Reply)
Discussion started by: mrn6430
1 Replies
LEARN ABOUT DEBIAN
test::data::scalar
Scalar(3pm) User Contributed Perl Documentation Scalar(3pm)NAME
Test::Data::Scalar -- test functions for scalar variables
SYNOPSIS
use Test::Data qw(Scalar);
DESCRIPTION
This modules provides a collection of test utilities for scalar variables. Load the module through Test::Data.
Functions
blessed_ok( SCALAR )
Ok if the SCALAR is a blessed reference.
defined_ok( SCALAR )
Ok if the SCALAR is defined.
undef_ok( SCALAR )
Ok if the SCALAR is undefined.
dualvar_ok( SCALAR )
Ok if the scalar is a dualvar.
How do I test this?
sub dualvar_ok ($;$) { my $ok = Scalar::Util::dualvar( $_[0] ); my $name = $_[1] || 'Scalar is a dualvar';
$Test->ok( $ok, $name );
$Test->diag("Expected a dualvar, didn't get it
")
unless $ok;
}
greater_than( SCALAR, BOUND )
Ok if the SCALAR is numerically greater than BOUND.
length_ok( SCALAR, LENGTH )
Ok if the length of SCALAR is LENGTH.
less_than( SCALAR, BOUND )
Ok if the SCALAR is numerically less than BOUND.
maxlength_ok( SCALAR, LENGTH )
Ok is the length of SCALAR is less than or equal to LENGTH.
minlength_ok( SCALAR, LENGTH )
Ok is the length of SCALAR is greater than or equal to LENGTH.
number_ok( SCALAR )
Ok if the SCALAR is a number ( or a string that represents a number ).
At the moment, a number is just a string of digits. This needs work.
number_between_ok( SCALAR, LOWER, UPPER )
Ok if the number in SCALAR sorts between the number in LOWER and the number in UPPER, numerically.
If you put something that isn't a number into UPPER or LOWER, Perl will try to make it into a number and you may get unexpected
results.
string_between_ok( SCALAR, LOWER, UPPER )
Ok if the string in SCALAR sorts between the string in LOWER and the string in UPPER, ASCII-betically.
readonly_ok( SCALAR )
Ok is the SCALAR is read-only.
ref_ok( SCALAR )
Ok if the SCALAR is a reference.
ref_type_ok( REF1, REF2 )
Ok if REF1 is the same reference type as REF2.
strong_ok( SCALAR )
Ok is the SCALAR is not a weak reference.
tainted_ok( SCALAR )
Ok is the SCALAR is tainted.
(Tainted values may seem like a not-Ok thing, but remember, when you use taint checking, you want Perl to taint data, so you should
have a test to make sure it happens.)
untainted_ok( SCALAR )
Ok if the SCALAR is not tainted.
weak_ok( SCALAR )
Ok if the SCALAR is a weak reference.
TO DO
* add is_a_filehandle test
* add is_vstring test
SEE ALSO
Scalar::Util, Test::Data, Test::Data::Array, Test::Data::Function, Test::Data::Hash, Test::Builder
SOURCE AVAILABILITY
This source is in Github:
http://github.com/briandfoy/test-data/tree/master
AUTHOR
brian d foy, "<bdfoy@cpan.org>"
COPYRIGHT AND LICENSE
Copyright (c) 2002-2009 brian d foy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2009-02-12 Scalar(3pm)