Hi I want to incremental add hex decimal number to a particula field in file
eg: addr =123 dept1=0
addr = 345 dept2 =1
addr2 = 124 dept3 =2
.
.
.
.
.
.
addr3 =567 dept15 =f
Is there any command which add... (8 Replies)
Hi all,
I am getting following output by using commands like sort, uniq and awk to the standard output.
110 d
40 a
59 c
9 b
3 e
Now at the end I would like to add all the numbers in column 1 and display the count of all numbers i.e. (110 + 40 + 59 + 9 + 3).
Also the output may... (3 Replies)
Anybody please help me...
Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary Coded Decimal) representation. Also, draw its Flow Chart.
This is a unix qn...
plz post algorithm for that :confused: (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary... (2 Replies)
Hi guys/gals i have a quick question. I am trying to read from a file and add the values up but the problem is the values are not integers their floats so i tried to used bc but failed epicly lol. Any tips would be great. Thanks
this is the code i have so far :
while read num
do
... (6 Replies)
Hi,
I want to convert two hexadecimal numbers to decimal using unix command line.
1cce446295197a9d6352f9f223a9b698
fc8f99ac06e88c4faf669cf366f60d
I tried using
`echo "ibase=16; $no |bc`
printf '%x\n' "1cce446295197a9d6352f9f223a9b698"
but it doesn't work for such big number it... (4 Replies)
Hi ,
seq can be 0...128
int windex = seq / 8;
int bindex = seq % 8;
unsigned char bitvalue = '\x01' << (7-bindex) ;
bpv.bitmapvalue = bitvalue;
This is the part of a program to convert decimal to bitmap value of hexadecimal.
I want this to change to convert only to... (1 Reply)
Hi Experts,
I have requirement to pad a decimal number that should have fixed length as 10.
if number is 234.234 > 234.234000
if number is 12.4 > 12.4000000
if number is 3456.5678 > 3456.56780
from above example we can see that overall length is 10 and padding is being done right sided of... (2 Replies)
I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies
LEARN ABOUT PHP
fnmatch
FNMATCH(3) 1 FNMATCH(3)fnmatch - Match filename against a patternSYNOPSIS
bool fnmatch (string $pattern, string $string, [int $flags])
DESCRIPTION fnmatch(3) checks if the passed $string would match the given shell wildcard $pattern.
PARAMETERS
o $pattern
- The shell wildcard pattern.
o $string
- The tested string. This function is especially useful for filenames, but may also be used on regular strings. The average user
may be used to shell patterns or at least in their simplest form to '?' and '*' wildcards so using fnmatch(3) instead of
preg_match(3) for frontend search expression input may be way more convenient for non-programming users.
o $flags
- The value of $flags can be any combination of the following flags, joined with the binary OR (|) operator.
A list of possible flags for fnmatch(3)
+-------------+---------------------------------------------------+
| $Flag | |
| | |
| | Description |
| | |
+-------------+---------------------------------------------------+
| | |
|FNM_NOESCAPE | |
| | |
| | Disable backslash escaping. |
| | |
| | |
|FNM_PATHNAME | |
| | |
| | Slash in string only matches slash in the given |
| | pattern. |
| | |
| | |
| FNM_PERIOD | |
| | |
| | Leading period in string must be exactly matched |
| | by period in the given pattern. |
| | |
| | |
|FNM_CASEFOLD | |
| | |
| | Caseless match. Part of the GNU extension. |
| | |
+-------------+---------------------------------------------------+
RETURN VALUES
Returns TRUE if there is a match, FALSE otherwise.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | This function is now available on Windows plat- |
| | forms. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
Checking a color name against a shell wildcard pattern
<?php
if (fnmatch("*gr[ae]y", $color)) {
echo "some form of gray ...";
}
?>
NOTES
Warning
For now, this function is not available on non-POSIX compliant systems except Windows.
SEE ALSO glob(3), preg_match(3), sscanf(3), printf(3), sprintf(3).
PHP Documentation Group FNMATCH(3)