I have the following script that renames filenames like:
blah_bleh_91_2011-09-26_00.05.43AM.xls
and transforms it in:
91_20110926_000543_3_blih.xls
It works fine except in the particular case of the example. When the hour is "00.0x" it does not work properly.
How do I trim the leading zeroes, and (+,-) in the currency field ?
I have a text file.
Your bill of +00002780.96 for a/c no. 25287324 is due on 11-06.
Your bill of +00422270.48 for a/c no. 28931373 is due on 11-06.
I want the O/P file to be like.
Your bill of 2780.96 for a/c no. 25287324... (22 Replies)
Hello, I am (trying) to write a script that will check to see how many users are logged on to my machine, and if that number is more than 60 I need to kill off all the oldest sessions that are over 60. So far I have been able to check how many users are on and now I am at the part where I have to... (3 Replies)
Helo ,
I m writing small module of c.on RHEL 4
I have one buffer (for e.g. buffer = "002"
now I want to check whethere buffer contains leading zeroes and if it contains
leading zeroes then I want to remove all leading zeroes
( i.e. if buffer = "002" then I want to make buffer = "2")
how... (1 Reply)
Hi,
I need add leading zeroes to a field in a file based on the character count. The field can be of 1 character to 6 character length. I need to make the field 14bytes.
eg:
8351,20,1
8351,234,6
8351,2,0
8351,1234,2
8351,123456,1
8351,12345,2
This should become.
... (3 Replies)
I have th following file
0000000011
0000000001
0000000231
0000000001
0000000022
noow when i run the following command
sed 's/^0+//g' file name
I receive the same output and the leading zeroes are not removed from the file . Please let me know how to achieve... (4 Replies)
Hi Forum.
I tried searching the forum but couldn't find a solution for my question.
I have the following data and would like to have a sed syntax to remove the leading zeroes from the 2nd field only:
Before:
2010-01-01|123|1|1000|2000|500|1500|600|700... (18 Replies)
Hi,
I have some hundreds/thousands of files named logX.dat, where X can be any integer, and they are sequential, X ranges between 1 and any number:
log1.dat log2.dat log3.dat log6.dat log10.dat ... log6000.dat
I would like to rename them to
scatter_params_0001.dat... (6 Replies)
Hello,
I got a question. I have several csv files with lots of data in it and for the first column i have EAN codes.
The problem that i am facing is that some of these codes have the leading 0 removed so they are 12 or less chars while a EAN code is (always?) 13 chars.
For this i used a... (9 Replies)
The awk below executes and produces the current output. it skips the header in row 1 and prints $4,$5,$6 and then adds the header row back.
The problem is that it keeps the tailing tab and prints it in front of $1. I could add a pipe to remove the tab, but is there a better way to do it with on... (7 Replies)
Discussion started by: cmccabe
7 Replies
LEARN ABOUT PHP
locale_get_display_script
LOCALE_GET_DISPLAY_SCRIPT(3) 1 LOCALE_GET_DISPLAY_SCRIPT(3)Locale::getDisplayScript - Returns an appropriately localized display name for script of the input locale
Object oriented style
SYNOPSIS
publicstatic string Locale::getDisplayScript (string $locale, [string $in_locale])
DESCRIPTION
Procedural style
string locale_get_display_script (string $locale, [string $in_locale])
Returns an appropriately localized display name for script of the input locale. If is NULL then the default locale is used.
PARAMETERS
o $locale
- The locale to return a display script for
o $in_locale
- Optional format locale to use to display the script name
RETURN VALUES
Display name of the script for the $locale in the format appropriate for $in_locale.
EXAMPLES
Example #1
locale_get_display_script(3) example
<?php
echo locale_get_display_script('sl-Latn-IT-nedis', 'en');
echo ";
";
echo locale_get_display_script('sl-Latn-IT-nedis', 'fr');
echo ";
";
echo locale_get_display_script('sl-Latn-IT-nedis', 'de');
?>
Example #2
OO example
<?php
echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'en');
echo ";
";
echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'fr');
echo ";
";
echo Locale::getDisplayScript('sl-Latn-IT-nedis', 'de');
?>
The above example will output:
Latin;
latin;
Lateinisch
SEE ALSO locale_get_display_name(3), locale_get_display_language(3), locale_get_display_region(3), locale_get_display_variant(3).
PHP Documentation Group LOCALE_GET_DISPLAY_SCRIPT(3)