i have several thousand files and in subdirs that are named
file.46634.txt
budget.75346.pdf
etc
i want to remove the number but retain the extension.
it is always a 5 digit.
thanks. (6 Replies)
Hi All,
Can you please help me.
The situation is like this. There are many different file name in this directory.
I have to grep all the file that the name start with "PTWO" and rename it to COM with the current date.
This is the script that I have done and it hit an... (16 Replies)
Hello~
I'm on AIX version 5 and I believe I have the tcsh shell environment to play in. Can you guys help me with a solution to rename all files that have "eclp" in the filename to "ecl" ? I basically want to rename the files and strip the "p" out.
i.e. original filenames:
... (3 Replies)
Hi,
I've got a large to task to do, which I've broken into three section. I'm just stuck on one of the sections.
I have to change the end of a filename from .txt to .doc in a directory. So if I have a directory called "folder1" and two files contained in it called "file1.txt" and "file2.txt",... (7 Replies)
In the Directory all the Files are following format.
Filename_yyyymmdd_numbers.txt
eg.
file_name_20120106_015802.txt .
I want to write the Shell script to rename all the file to
file_name.txt.in the directory.
Thanks
Mani (5 Replies)
I would like to wget a file "index.html" from a site which is lies in different subdirectories and is different in size. The index.html shall be concatenated or renamed to index01.html index02.html .... I would like to store this file in just one directory and use the option -nd. Though i can't get... (0 Replies)
Hi,
I have files with filenames as below.
SGM Daily Sales Email-en-us-05312012.xlwa
I want to rename it in .xls. I am writing a script to change this, as there can be multiple files in subfolders.
I have the following script.
#!/bin/ksh
for oldfile in $(find... (1 Reply)
Hi, I need a bit of help.
I've used awk to get the first 7 characters of a file -
awk '{print substr($0,0,7)}' test.csv
How do I now take this variable to rename test.csv to variable.csv ?
Any help or advice would be greatly appreciated! (2 Replies)
I have 2 files sorted by numerically. I need help with shell script to read these 2 files and do a 1:1 mapping and rename the filenames with the mapped case#;
For example:
cat case.txt
10_80
10_90
cat files.txt
A BCD_x 1.pdf
A BCD_x 2.pdf
ls pdf_dir
A BCD_x 1.pdf A BCD_x 2.pdf
... (2 Replies)
Hello,
I have some video files containing numbers and characters . To tell the problem shortly, due to a limitation, I am unable create a playlist regularly changing on a daily basis with the command shuffle....So I decided to rename filenames, just a replacement of first five numbers randomly.... (10 Replies)
Discussion started by: baris35
10 Replies
LEARN ABOUT PHP
is_dir
IS_DIR(3) 1 IS_DIR(3)is_dir - Tells whether the filename is a directorySYNOPSIS
bool is_dir (string $filename)
DESCRIPTION
Tells whether the given filename is a directory.
PARAMETERS
o $filename
- Path to the file. If $filename is a relative filename, it will be checked relative to the current working directory. If $file-
name is a symbolic or hard link then the link will be resolved and checked. If you have enabled safe mode, or open_basedir further
restrictions may apply.
RETURN VALUES
Returns TRUE if the filename exists and is a directory, FALSE otherwise.
EXAMPLES
Example #1
is_dir(3) example
<?php
var_dump(is_dir('a_file.txt'));
var_dump(is_dir('bogus_dir/abc'));
var_dump(is_dir('..')); //one dir up
?>
The above example will output:
bool(false)
bool(false)
bool(true)
ERRORS /EXCEPTIONS
Upon failure, an E_WARNING is emitted.
NOTES
Note
The results of this function are cached. See clearstatcache(3) for more details.
Tip
As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine
which wrappers support stat(3) family of functionality.
SEE ALSO chdir(3), dir(3), opendir(3), is_file(3), is_link(3).
PHP Documentation Group IS_DIR(3)