"ab"c",asb,"dfe 7"",bbv",12345,q17,"a field with a comma, here",1234.56
If I issue (will print if a match is found)
myoutfile is always empty.
If I issue
myoutfile contains the contents of myfile
This tells me that I can find zero or more 'anything's, but not one or more 'anything's. Surely sed can find one or more 'anything's in my single record?
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories..
it is like this,
current directory contains
file1, file2, file3, dir1, dir2
and dir1 conatins
file4, file5
and dir2 contains
file6,... (9 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
I am new to bash/shell scripting.
I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”.
I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
These three finds worked as expected:
$ find . -iname "*.PDF"
$ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \)
$ find . -path "*_nobackup*" -prune -iname "*.PDF"
They all returned the match:
./folder/file.pdf
:b:
This find returned no matches:
$ find . -path "*_nobackup*" -prune... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
I am trying find files in sub dir with certain tags using tag command, and add the period to the beginning. I can't use chflags hidden {} cause it doesn't add period to the beginning of the string for web purpose. So far with my knowledge, I only know mdfind or tag can be used to search files with... (6 Replies)
Discussion started by: Nexeu
6 Replies
LEARN ABOUT PHP
number_format
NUMBER_FORMAT(3) 1 NUMBER_FORMAT(3)number_format - Format a number with grouped thousandsSYNOPSIS
string number_format (float $number, [int $decimals])
DESCRIPTION
string number_format (float $number, int $decimals, string $dec_point = ".", string $thousands_sep = ",")
This function accepts either one, two, or four parameters (not three):
If only one parameter is given, $number will be formatted without decimals, but with a comma (",") between every group of thousands.
If two parameters are given, $number will be formatted with $decimals decimals with a dot (".") in front, and a comma (",") between every
group of thousands.
If all four parameters are given, $number will be formatted with $decimals decimals, $dec_point instead of a dot (".") before the decimals
and $thousands_sep instead of a comma (",") between every group of thousands.
PARAMETERS
o $number
- The number being formatted.
o $decimals
- Sets the number of decimal points.
o $dec_point
- Sets the separator for the decimal point.
o $thousands_sep
- Sets the thousands separator.
RETURN VALUES
A formatted version of $number.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.4.0 | |
| | |
| | This function now supports multiple bytes in |
| | $dec_point and $thousands_sep. Only the first |
| | byte of each separator was used in older ver- |
| | sions. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
number_format(3) Example
For instance, French notation usually use two decimals, comma (',') as decimal separator, and space (' ') as thousand separator.
This is achieved with this line :
<?php
$number = 1234.56;
// english notation (default)
$english_format_number = number_format($number);
// 1,235
// French notation
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,56
$number = 1234.5678;
// english notation without thousands separator
$english_format_number = number_format($number, 2, '.', '');
// 1234.57
?>
SEE ALSO money_format(3), sprintf(3), printf(3), sscanf(3).
PHP Documentation Group NUMBER_FORMAT(3)