Hi all,
I have created a script which adding two columns and removing two columns for all files.
Filename: Cust_information_1200_201010.txt
Source Data:
"1","Cust information","123","106001","street","1-203 high street"
"1","Cust information","124","105001","street","1-203 high street"
... (0 Replies)
Hi All,
i have a .Csv file in the below format
startTime, endTime, delta, gName, rName, rNumber, m2239max, m2239min, m2239avg, m100016509avg, m100019240max, metric3min, m100019240avg, propValues
11-Mar-2012 00:00:00, 11-Mar-2012 00:05:00, 300.0, vma3550a, a-1_CPU Index<1>, 200237463, 0.0,... (9 Replies)
Hi ALL
I have a script where in i need to check for several values in if conditons but when i execute the script it throws error such as "TOO MANY ARGUMENTS"
if
then
msg="BM VAR Issue :: bmaRequestVAR=$bmaRequestVAR , nltBMVAR=$nltBMVAR , bmaResponseVAR=$bmaResponseVAR ,... (10 Replies)
Hello everyone,
I searched the forum looking for answers to this but I could not pinpoint exactly what I need as I keep having trouble.
I have many files each having two columns and hundreds of rows.
first column is a string (can have many words) and the second column is a number.The files are... (5 Replies)
Hi Friends,
I have come across some files where some of the columns don not have data.
Key, Data1,Data2,Data3,Data4,Data5
A,5,6,,10,,
A,3,4,,3,,
B,1,,4,5,,
B,2,,3,4,,
If we see the above data on Data5 column do not have any row got filled. So remove only that column(Here Data5) and... (4 Replies)
Hi all, I know this sounds suspiciously like a homework course; but, it is not.
My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns.
I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Hello All,
I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns.
So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
HI All,
I'm embedding SQL query in Script which gives following output:
Assignee Group Total
ABC Group1 17
PQR Group2 5
PQR Group3 6
XYZ Group1 10
XYZ Group3 5
I have saved the above output in a file.
How do i sum up the contents of this output so as to get following output:
... (4 Replies)
Discussion started by: Khushbu
4 Replies
LEARN ABOUT PHP
maxdb_fetch_fields
MAXDB_FETCH_FIELDS(3) 1 MAXDB_FETCH_FIELDS(3)maxdb_fetch_fields - Returns an array of resources representing the fields in a result set
Procedural style
SYNOPSIS
mixed maxdb_fetch_fields (resource $result)
DESCRIPTION
Object oriented style
mixed maxdb_result::fetch_fields (void )
This function serves an identical purpose to the maxdb_fetch_field(3) function with the single difference that, instead of returning one
resource at a time for each field, the columns are returned as an array of resources.
RETURN VALUES
Returns an array of resources which contains field definition information or FALSE if no field information is available.
Object properties
+-----------+---------------------------------------------------+
| Property | |
| | |
| | Description |
| | |
+-----------+---------------------------------------------------+
| name | |
| | |
| | The name of the column |
| | |
|max_length | |
| | |
| | The maximum width of the field for the result |
| | set. |
| | |
| type | |
| | |
| | The data type used for this field |
| | |
| decimals | |
| | |
| | The number of decimals used (for integer fields) |
| | |
+-----------+---------------------------------------------------+
EXAMPLES
Example #1
Object oriented style
<?php
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
$query = "SELECT name, cno from hotel.customer ORDER BY cno";
if ($result = $maxdb->query($query)) {
/* Get field information for all columns */
$finfo = $result->fetch_fields();
foreach ($finfo as $val) {
printf("Name: %s
", $val->name);
printf("Table: %s
", $val->table);
printf("max. Len: %d
", $val->max_length);
printf("Flags: %d
", $val->flags);
printf("Type: %d
", $val->type);
}
$result->close();
}
/* close connection */
$maxdb->close();
?>
Example #2
Procedural style
<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
$query = "SELECT name, cno from hotel.customer ORDER BY cno";
if ($result = maxdb_query($link, $query)) {
/* Get field information for all columns */
$finfo = maxdb_fetch_fields($result);
foreach ($finfo as $val) {
printf("Name: %s
", $val->name);
printf("Table: %s
", $val->table);
printf("max. Len: %d
", $val->max_length);
printf("Flags: %d
", $val->flags);
printf("Type: %d
", $val->type);
}
maxdb_free_result($result);
}
/* close connection */
maxdb_close($link);
?>
The above example will output something similar to:
Name: NAME
Table:
max. Len: 10
Flags: -1
Type: 2
Name: CNO
Table:
max. Len: 4
Flags: -1
Type: 0
SEE ALSO maxdb_num_fields(3), maxdb_fetch_field(3), maxdb_fetch_field_direct(3).
PHP Documentation Group MAXDB_FETCH_FIELDS(3)