Hello All,
Plz help me with:
I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
Hi,
Can anyone help in the below problem.
file1 has the below contents
fileset 999 primary-ilist inode 37020 has invalid dotdot (426094) -> Not exist
fileset 999 primary-ilist inode 115016 dup block ->... (9 Replies)
Hi,
Can anyone help me out to check whether the input argument is number?
Example:
REQUEST_ID="123456"
I need to check the REQUEST_ID value is number or string.
Thanks in Advance
Regards
BS (6 Replies)
Hi,
I have a file with data as given
$cat file1.txt
123
234
23e
234.456
234.876e
345.00
I am checking if the values are proper integers using the command.
nawk -F'|' 'int($1)!=$1 {printf "Error in field 1|"$0"\n"}' file1.txt
This is checking for only integers ( without... (10 Replies)
I have a txt file as database. when i run my program what it does is it ask me for 3 name and stored in the file as
name1:name2:name3:1
when u enter 3 name it add those in file as above format and add 1 at the end. I what i want is if i enter same names again it changes that 1 to 2 and so... (3 Replies)
Hey I'm new in linux,
I'm looking for a code to check whether the parameter is a number or a string.
I have already tried this code:
eerste=$(echo $1 | grep "^*$">aux)
if
But it doesn't work.:confused:
Thanks (2 Replies)
I want to append file with a string but before doing that i want to check if this string already exist in that file.I tried with grep on Solaris 10 but unsuccessful.Man pages from grep seems to suggest if the string is found command status will be 0 and if not 1.But i am not finding it.May be i... (2 Replies)
I have below code inside my awk script
if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr=$0;
}
}
else if ( $0 ~ /^SVC OUT:/ )
{
svc_out=substr( $0, 9, 3);
if (msg_start == 1 && msg_end == 0)
... (6 Replies)
Discussion started by: bhagya123
6 Replies
LEARN ABOUT PHP
mssql_fetch_field
MSSQL_FETCH_FIELD(3)MSSQL_FETCH_FIELD(3)mssql_fetch_field - Get field informationSYNOPSIS
object mssql_fetch_field (resource $result, [int $field_offset = -1])
DESCRIPTION mssql_fetch_field(3) can be used in order to obtain information about fields in a certain query result.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(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
Returns an object containing field information.
The properties of the object are:
o name - column name. if the column is a result of a function, this property is set to computed#N, where #N is a serial number.
o column_source - the table from which the column was taken
o max_length - maximum length of the column
o numeric - 1 if the column is numeric
o type - the column type.
EXAMPLES
Example #1
mssql_fetch_field(3) example
<?php
// Connect to MSSQL and select the database
mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Send a select query to MSSQL
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
// Construct table
echo '<h3>Table structure for 'persons'</h3>';
echo '<table border="1">';
// Table header
echo '<thead>';
echo '<tr>';
echo '<td>Field name</td>';
echo '<td>Data type</td>';
echo '<td>Max length</td>';
echo '</tr>';
echo '</thead>';
// Dump all fields
echo '<tbody>';
for ($i = 0; $i < mssql_num_fields($query); ++$i) {
// Fetch the field information
$field = mssql_fetch_field($query, $i);
// Print the row
echo '<tr>';
echo '<td>' . $field->name . '</td>';
echo '<td>' . strtoupper($field->type) . '</td>';
echo '<td>' . $field->max_length . '</td>';
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
// Free the query result
mssql_free_result($query);
?>
SEE ALSO mssql_field_seek(3).
PHP Documentation Group MSSQL_FETCH_FIELD(3)