Hi,
I need to write a shell script (ksh) to read contents starting at a specific location from one file and append the contents at specific location in another file. Please find below the contents of the source file that I need to read the contents from,
File 1
-----# more... (5 Replies)
First I' d like to say you guys are awesome. :)
I have a word document that I cut and paste into Textpad and it removed all the fancy formatting which is fine with me. I WinScp'd it to the box and and called it inputfile.txt.
Opened it in vi and don't see any special characters or stuff that... (2 Replies)
hi,
it seems i can read using
cat file | while read line
but when i tried reading using
while read line < myfile
then the last line kept on being returned
why?
thanks (2 Replies)
I have a file which has following contents:
localhost_IP_SIP_1233026552455.xml
localhost_IP_SIP_1233026552460.xml
localhost_IP_SIP_1233026552467.xml
localhost_IP_SIP_1233026552759.xml
localhost_IP_SIP_1233026552969.xml
localhost_IP_SIP_1233026552975.xml ... (2 Replies)
Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .
Hi I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.
I want to create a mutiple output files with each file having a... (2 Replies)
Data
I was trying to write shell script which will be return the output in the below format
First i was trying to do these using sed.
sed -n '/.ksh/p' mainksh.ksh
sed -e 's/*\(.*\)/\1/g' mainksh.ksh
$RUN_DIR, $SUB_DIR and the variables which will be defined in the profile file.
when i am... (0 Replies)
Hi Guys,
I need to read a file until I find a blank line. and in the next iteration I want to continue reading from the line I find a keyword.
For ex: my file looks like
PDS_JOB_ALIAS
CRITERIA_ITEM_TYPE
PDS_JOB_CRITERIA_ITEM
CRITERIA_ITEM_TYPE
First I want to read the file... (2 Replies)
Hi,
I am doing something basic, but I am missing something. Im trying to read the contents of a file and taking those values and connecting to a database. However, it only connect to one (or reads in) value and then exists.
Here is what it looks like:
listname.txt
db1
db2
db3
Script:... (15 Replies)
So I'm stumped.
First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes.
I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies
LEARN ABOUT PHP
get_class_vars
GET_CLASS_VARS(3) 1 GET_CLASS_VARS(3)get_class_vars - Get the default properties of the classSYNOPSIS
array get_class_vars (string $class_name)
DESCRIPTION
Get the default properties of the given class.
PARAMETERS
o $class_name
- The class name
RETURN VALUES
Returns an associative array of declared properties visible from the current scope, with their default value. The resulting array elements
are in the form of varname => value. In case of an error, it returns FALSE.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.0.3 | |
| | |
| | get_class_vars(3) will only return the properties |
| | that can be accessed from the current scope. |
| | |
| 5.0.2 | |
| | |
| | Calling get_class_vars(3) will now expose all |
| | the properties as an array, unlike previous be- |
| | haviour where protected and private properties |
| | were prefixed with nul bytes. |
| | |
| 5.0.1 | |
| | |
| | Calling get_class_vars(3) will expose all prop- |
| | erties, as when converting an object to a class. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
get_class_vars(3) example
<?php
class myclass {
var $var1; // this has no default value...
var $var2 = "xyz";
var $var3 = 100;
private $var4;
// constructor
function myclass() {
// change some properties
$this->var1 = "foo";
$this->var2 = "bar";
return true;
}
}
$my_class = new myclass();
$class_vars = get_class_vars(get_class($my_class));
foreach ($class_vars as $name => $value) {
echo "$name : $value
";
}
?>
The above example will output:
var1 :
var2 : xyz
var3 : 100
Example #2
get_class_vars(3) and scoping behaviour
<?php
function format($array)
{
return implode('|', array_keys($array)) . "
";
}
class TestCase
{
public $a = 1;
protected $b = 2;
private $c = 3;
public static function expose()
{
echo format(get_class_vars(__CLASS__));
}
}
TestCase::expose();
echo format(get_class_vars('TestCase'));
?>
The above example will output:
// 5.0.0
a| * b| TestCase c
a| * b| TestCase c
// 5.0.1 - 5.0.2
a|b|c
a|b|c
// 5.0.3 +
a|b|c
a
SEE ALSO get_class_methods(3), get_object_vars(3).
PHP Documentation Group GET_CLASS_VARS(3)