$ cat file
a:12:56:12
b:23:12:23
d:32:24:12
c:90:12:24
required output:
a:12:56:12
b:23:12:23
d:32:24:12
c:90:12:24
t:157:104:71
t line is the total line, which will be the last line in the output.
Please help.
I tried this: (4 Replies)
I am trying to use awk to create a summary of a structured file. Here is what it looks like:
(random text)
H1 H2 H3 H4
44 78 99 30
31 -- 32 21
12 33 55 21
I'd like to be able to specify a column, say H2, and then have information about that column printed. ... (4 Replies)
I have a data file similar to this (but many millions of lines long). You can assume that it is totally unsorted but has no duplicate rows.
Date ,Tool_Type ,Tool_ID ,Time_Used
3/13/2014,Screwdriver,Screwdriver02, 6
3/13/2014,Screwdriver,Screwdriver02,20... (2 Replies)
Hello , I have several files which are looking similar to :
file01.txt
keyA001 350 X string001 value001
keyA001 450 X string002 value007
keyA001 454 X string002 value004
keyA001 500 X string003 value005
keyA001 255 X string004 value006
keyA001 388 X string005 value008
keyA001 1278 X... (4 Replies)
Discussion started by: alex2005
4 Replies
LEARN ABOUT PHP
cubrid_field_type
CUBRID_FIELD_TYPE(3) 1 CUBRID_FIELD_TYPE(3)cubrid_field_type - Return the type of the column corresponding to the given field offsetSYNOPSIS
string cubrid_field_type (resource $result, int $field_offset)
DESCRIPTION
This function returns the type of the column corresponding to the given field offset. The returned field type could be one of the follow-
ing: "int", "real", "string", etc.
PARAMETERS
o $result
-Array type of the fetched result CUBRID_NUM, CUBRID_ASSOC, CUBRID_BOTH.
o $field_offset
- The numerical field offset. The $field_offset starts at 0. If $field_offset does not exist, an error of level E_WARNING is also
issued.
RETURN VALUES
Type of the column, on success.
FALSE when invalid field_offset value.
-1 if SQL sentence is not SELECT.
EXAMPLES
Example #1
cubrid_field_type(3) example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$result = cubrid_execute($conn, "SELECT * FROM code");
$col_num = cubrid_num_cols($result);
printf("%-15s %-15s %s
", "Field Table", "Field Name", "Field Type");
for($i = 0; $i < $col_num; $i++) {
printf("%-15s %-15s %s
",
cubrid_field_table($result, $i), cubrid_field_name($result, $i), cubrid_field_type($result, $i));
}
cubrid_disconnect($conn);
?>
The above example will output:
Field Table Field Name Field Type
code s_name char
code f_name varchar
PHP Documentation Group CUBRID_FIELD_TYPE(3)