Hi,
I have a file with on one line a uid, and on the next line a date. I am trying to make the to into one line.
Here's an example:
koppx
20031125
kraan
20031119
sarox
20031107
And this is what i want it to be:
koppx;20031125
kraan;20031119
sarox;20031107
I have been trying... (4 Replies)
can anyone tell me as "how to join all lines in a file " using a shell script
Actually i have many files in a directory and for each file i want to join all the lines using a shell scrip .
Thanks in advance!!! (8 Replies)
hi all i have sample and i need script to do this
/dev/xxx oracle test
/dev/sap
9999 000 88 99
i need the out put like this
/dev/xxx oracle test
/dev/sap 9999 000 88 99
can any one provide me with an idea to solve this problem (8 Replies)
Hi ,
I have below file with 13 columns. I need 2-13 columns seperated by comma and I want to append each row with a string "INSERT INTO xxx" in the begining as 1st column and then a variable "$node" and then $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13 and at the end another string " ; COMMIT;"
... (4 Replies)
I want to join this two lines but only when after him
I have nothing or a comma
Yes, I know Jonesy, and I'll give him
about one more minute.
this two lines must become
Yes, I know Jonesy, and I'll give him about one more minute.
thank you very much (11 Replies)
Hi,
I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Hi
how do I join files like below in script.
Thanks,
Ashan
there are may line like this in the file.
zone name DR_TMP_A_sev1_3eA vsan 200
pwwn 50:00:09:73:f0:16:35:08
pwwn c0:50:76:08:6e:dc:00:16
zone name DR_TMP_A_SVR2_3eA vsan 200
pwwn 50:00:09:73:f0:16:35:08
pwwn... (4 Replies)
I have been searching and trying to come up with an awk that will perform the following on a
converted text file (original is a pdf).
1. Since the first two lines are (begin with) text they are removed
2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Hi, In my previous post ( How to print lines from a files with specific start and end patterns and pick only the last lines? ), i have got a help to get the last select statement from a file, now i need to remove/exclude the output from main file:
Input File format:
SELECT
ABCD,
DEFGH,... (2 Replies)
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Discussion started by: nani2019
5 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)