This is purely longhand to show a way of building up each line ready for use.
There are no loops nor the usage of the mv command.
It uses __builtins__ only and is step by step in the code shown/
It is a little tongue-in-cheek but shows the power of the shell.
OSX 10.7.5, default bash terminal.
Results...
Hi all
how can can remove the underscore from this number in this series
_1234567.abc
_1234567.abcd
I was trying mv _1234567* 1234567
but did not work ?
thanks
s (2 Replies)
hi friends,
I writing a script to psot dataset to ceratin server.....while doing ftp I have to rename the file while which is in present server like
present :test server
filename data.097878.
ftp server: it sholu be renamed as data.097878.zip
thanks,
The thing is that while... (1 Reply)
Hi, I've already search for this issue but I found different scripts for rename files, but I don't know how to customize it for my needs.
Here's what I want to do:
I have a lot of files inside many directories, like this:
/aa/01.txt
/aa/02.txt
/ab/01.txt
/ab/02.txt
I want all those files... (2 Replies)
hi,
im doin an assignment which requires you to build a shell script to do the MS DOS style equivilant (sp?) of the rename function. What i have to do is a loop which checks the following rules and output messages (same):
Can't have anything after target
Can't have more than one dot
Can't... (1 Reply)
hi guys i am writing a script to change the filename which is enterered as input to lower case letter even if one letter is upper case i have to change it to lower case
i get the input and use
sed comand should i use like that
sed/s/a-z/A-Z/d
will it be like that can u please help me (8 Replies)
Hi,
I am new to Unix and i have a requirement where i need to write a shell script where i have to loop through various files present in a directory and rename them based on below criteria.
Files in the folder are in the following format. _YYYYMMDD.dat]
SDL_V1_20100530.dat... (6 Replies)
how to rename a file if I don't know file location ?
Can we below command :
$ find / | mv file1.txt
I am not sure........can any1 help me out ?
Thanks,
Tushar Joshi:mad: (1 Reply)
hello, all
I have following files:
file_1 file_2 file_3 ... file_9
Now I want to rename them as:
file_001 file_002 file_003 ... file_009
how to use function 'rename' to accomplish this task? (2 Replies)
Renaming files using rename on the following files
rename 's/.99999/.99999.sac.pzs/g' *.99999
sac_pzs_iv_esml_hhz__2013.074.10.18.23.0000_2599.365.23.59.59.99999
sac_pzs_iv_favr_hhe__2010.187.00.00.00.0000_2599.365.23.59.59.99999... (1 Reply)
Discussion started by: kristinu
1 Replies
LEARN ABOUT PHP
datefmt_localtime
DATEFMT_LOCALTIME(3) 1 DATEFMT_LOCALTIME(3)IntlDateFormatter::localtime - Parse string to a field-based time value
Object oriented style
SYNOPSIS
public array IntlDateFormatter::localtime (string $value, [int &$position])
DESCRIPTION
Procedural style
array datefmt_localtime (IntlDateFormatter $fmt, string $value, [int &$position])
Converts string $value to a field-based time value ( an array of various fields), starting at $parse_pos and consuming as much of the
input value as possible.
PARAMETERS
o $fmt
- The formatter resource
o $value
- string to convert to a time
o $position
- Position at which to start the parsing in $value (zero-based). If no error occurs before $value is consumed, $parse_pos will
contain -1 otherwise it will contain the position at which parsing ended . If $parse_pos > strlen($value), the parse fails immedi-
ately.
RETURN VALUES
Localtime compatible array of integers : contains 24 hour clock value in tm_hour field
EXAMPLES
Example #1
datefmt_localtime(3) example
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$arr = datefmt_localtime($fmt, 'Wednesday, December 31, 1969 4:00:00 PM PT', 0);
echo 'First parsed output is ';
if ($arr) {
foreach ($arr as $key => $value) {
echo "$key : $value , ";
}
}
?>
Example #2
OO example
<?php
$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$arr = $fmt->localtime('Wednesday, December 31, 1969 4:00:00 PM PT', 0);
echo 'First parsed output is ';
if ($arr) {
foreach ($arr as $key => $value) {
echo "$key : $value , ";
}
}
?>
The above example will output:
First parsed output is tm_sec : 0 , tm_min : 0 , tm_hour : 16 , tm_year : 1969 ,
tm_mday : 31 , tm_wday : 4 , tm_yday : 365 , tm_mon : 11 , tm_isdst : 0 ,
SEE ALSO datefmt_create(3), datefmt_format(3), datefmt_parse(3), datefmt_get_error_code(3), datefmt_get_error_message(3).
PHP Documentation Group DATEFMT_LOCALTIME(3)