Could you please try following once. This is specifically for 35th character's replacement.
I am using substring function of awk to get first 34 characters and then printing 7 along with rest of the characters of line.
Hi All,
I have a file which has data in following format:
"Body_Model","2/1/2007","2/1/2007"
"CSCH74","0","61"
"CSCS74","0","647"
"CSCX74","0","3"
"CSYH74","0","299"
"CSYS74","0","2514"
"CSYX74","0","3"
"Body_Model","3/1/2007","3/1/2007"
"CSCH74","0","88"
"CSCS74","0","489"... (3 Replies)
I have the below file ...where some of the column values should replaced with desired values ....below file u can find that 3 column where ever 'AAA' comes should replaced with ' CC '
NOTE : we have to pass the column number ,AAA,CC (modified value) as the parameters to the code.
... (6 Replies)
Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is:
1702938475,SNU022,201004
the first 10 numbers always begin with 170 (6 Replies)
Hello,
I have a file with four columns and I would like to replace values in the second column only.
An arbitrary example is:
100 A 105 B
200 B 205 C
300 C 305 D
400 D 405 E
500 E 505 F
I need to replace the second column as shown below:
... (4 Replies)
Dear all,
I have a file1.pdb in pdb format and a dat file2 containing values, corresponding to the atoms in the pdb file. these values (file2.dat) need to be in the column instead of the 0.00 (file1) values for each atom in file1.pdb .(the red values must be replaced by the blue ones,in order)... (11 Replies)
How could i take an input file and split the numeric values from the alpha values (123 vs abc) to distinc columns, and if the source is blank to keep it blank (null) in both of the new columns:
So if the source file had a column like:
Value:
|1 |
|2.3|
| |
|No|
I would... (7 Replies)
I have one file as it has the following format
File1
S No Site IP Address
1 Australia 192.168.0.1/26
2 Australia 192.168.0.2/26
3 Australia 192.168.0.3/26
I need awk/sed command to replace the column2 value ( under Site) with some other... (8 Replies)
From googling and reading man pages I figured out this sorts the first column by numeric values.
sort -g -k 1,1
Why does the -n option not work? The man pages were a bit confusing.
And what if I want to sort the second column numerically? I haven't been able to figure that out. The file... (7 Replies)
Discussion started by: cokedude
7 Replies
LEARN ABOUT PHP
cubrid_fetch_field
CUBRID_FETCH_FIELD(3) 1 CUBRID_FETCH_FIELD(3)cubrid_fetch_field - Get column information from a result and return as an objectSYNOPSIS
object cubrid_fetch_field (resource $result, [int $field_offset])
DESCRIPTION
This function returns an object with certain properties of the specific column. The properties of the object are:
o $name
-column name
o $table
-name of the table that the column belongs to
o $def
-default value of the column
o $max_length
-maximum length of the column
o $not_null
-1 if the column cannot be NULL
o $primary_key
-1 if the column is a primary key
o $unique_key
-1 if the column is an unique key
o $multiple_key
-1 if the column is a non-unique key
o $numeric
-1 if the column is numeric
o $blob
-1 if the column is a BLOB
o $type
-the type of the column
o $unsigned
-1 if the column is unsigned
o $zerofill
-1 if the column is zero-filled
PARAMETERS
o $result
-$result comes from a call to cubrid_execute(3)
o $field_offset
- The numerical field offset. If the field offset is not specified, the next field (that was not yet retrieved by this function)
is retrieved. The $field_offset starts at 0.
RETURN VALUES
Object with certain properties of the specific column, when process is successful.
FALSE on failure.
EXAMPLES
Example #1
cubrid_fetch_field(3) example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$req = cubrid_execute($conn, "SELECT event_code,athlete_code,nation_code,game_date FROM game WHERE host_year=1988 and event_code=20001;");
var_dump(cubrid_fetch_row($req));
cubrid_field_seek($req, 1);
$field = cubrid_fetch_field($req);
printf("
--- Field Properties ---
");
printf("%-30s %s
", "name:", $field->name);
printf("%-30s %s
", "table:", $field->table);
printf("%-30s "%s"
", "default value:", $field->def);
printf("%-30s %d
", "max length:", $field->max_length);
printf("%-30s %d
", "not null:", $field->not_null);
printf("%-30s %d
", "primary key:", $field->primary_key);
printf("%-30s %d
", "unique key:", $field->unique_key);
printf("%-30s %d
", "multiple key:", $field->multiple_key);
printf("%-30s %d
", "numeric:", $field->numeric);
printf("%-30s %d
", "blob:", $field->blob);
printf("%-30s %s
", "type:", $field->type);
printf("%-30s %d
", "unsigned:", $field->unsigned);
printf("%-30s %d
", "zerofill:", $field->zerofill);
cubrid_close_request($req);
cubrid_disconnect($conn);
?>
The above example will output:
array(4) {
[0]=>
string(5) "20001"
[1]=>
string(5) "16681"
[2]=>
string(3) "KOR"
[3]=>
string(9) "1988-9-30"
}
--- Field Properties ---
name: athlete_code
table: game
default value: ""
max length: 0
not null: 1
primary key: 1
unique key: 1
multiple key: 0
numeric: 1
blob: 0
type: integer
unsigned: 0
zerofill: 0
PHP Documentation Group CUBRID_FETCH_FIELD(3)