04-06-2009
Hi Raghav,
DOS as well has a single command which does teh same job... see below e.g.
C:\Documents and Settings\ilango>echo . > abc1092.txt
C:\Documents and Settings\ilango>echo . > abc1022.txt
C:\Documents and Settings\ilango>echo . > abc1023.txt
C:\Documents and Settings\ilango>echo . > abc1024.txt
C:\Documents and Settings\ilango>for /F %i in ('dir /B abc*') do move /Y %i abc
.txt
C:\Documents and Settings\ilango>move /Y abc1022.txt abc.txt
C:\Documents and Settings\ilango>move /Y abc1023.txt abc.txt
C:\Documents and Settings\ilango>move /Y abc1024.txt abc.txt
C:\Documents and Settings\ilango>move /Y abc1092.txt abc.txt
C:\Documents and Settings\ilango>
/ilan
Last edited by ilan; 04-06-2009 at 04:48 PM..
Reason: cleanup in teh e.g.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
is it possible to see what is in a dds tape?
like in dos, we can write dir a: to see the contents of it?
thanks
PS : actually, i came from a DOS background. so most of the time, i will try to relate unix to dos. of course, dos never came close to unix. but unix is like many instances of dos... (3 Replies)
Discussion started by: yls177
3 Replies
2. Shell Programming and Scripting
I have bunch of files in win xp machine with
123456 E15 filename
112333.E20 filename
123412.E11 filename
you get the pic, I mount that xp machine's share into linux and try to do a mass rename to something simpler
E15 filename
E20 filename and so on..
I wrote below thinking that it... (8 Replies)
Discussion started by: hankooknara
8 Replies
3. Shell Programming and Scripting
Hi
I have a dos batch file in window server where I call a cmd command for creating some db.
this cmd commad is located in e:\data\abcd\xyz.cmd.
Now I call this batch file from unix ssh.sh but my access point is D in window server here I want to change the dos prompt to e:\data\abcd.
in... (3 Replies)
Discussion started by: Jamil Qadir
3 Replies
4. Shell Programming and Scripting
Hey guys i'm creating a dos style rename script, so if a user types say q14.* as the 1st param and b14.* as the 2nd and will rename all q14 files to b14 but keep the extensions, so i've developed nearly the full script "i think", if i use echo(echo "if $1 had been renamed it would now be... (3 Replies)
Discussion started by: fblade1987
3 Replies
5. Shell Programming and Scripting
Started a thread in beginners but I thought someone from this forum may have an idea as well. Thanks!
EDITED BY REBORG (3 Replies)
Discussion started by: robotsbite
3 Replies
6. Windows & DOS: Issues & Discussions
Hi,
(Apologies, I'm sure I'm not the first person to raise this question but so far in my searches haven't found a good answer).
I would like to output a listing per line of filename (including full path) and 'last updated' timestamp. e.g:
Z:\dir1\file1.txt 01/02/2010 10:43... (5 Replies)
Discussion started by: GM_AIX
5 Replies
7. Shell Programming and Scripting
Hello there! I'm having a lot of trouble writing a script.
The script is supposed to:
1) Find all files with the name "Object.mtl" within each folder in the directory: /Users/username/Desktop/convert/Objects
2) Search and replace the string ".bmp" with ".tif" (without the quotations)
3)... (1 Reply)
Discussion started by: Blue Solo
1 Replies
8. Shell Programming and Scripting
Hi,
This is my DOS Batch file.
@echo off
echo "Program Name :" %0
rem echo "Next param :" %1
echo "Next param :" "Username/Password"
echo "User Id :" %2
echo "User Name :" %3
echo "Request ID ... (4 Replies)
Discussion started by: Rami Reddy
4 Replies
9. Shell Programming and Scripting
Hi All,
I am trying to check if the file is in dos format using simple grep command but the problem is lines inside the file with have special characters in between and in some lines end of the line will have the '^M' character.
I tried the below command in simple line(without special... (7 Replies)
Discussion started by: Optimus81
7 Replies
10. Shell Programming and Scripting
I have files in the ABC_YYYYMMDD.zip format under a directory. Each zip file contains A text file in the ABC_YYYYMMDD.txt format.
I am trying to create a script that will Rename the zip files and their underlying text file replacing the datepart in them with .
For eg: in the case of... (1 Reply)
Discussion started by: bash987
1 Replies
LEARN ABOUT PHP
ziparchive.addfile
ZIPARCHIVE.ADDFILE(3) 1 ZIPARCHIVE.ADDFILE(3)
ZipArchive::addFile - Adds a file to a ZIP archive from the given path
SYNOPSIS
bool ZipArchive::addFile NULL (string $filename, [string $localname], [int $start], [int $length])
DESCRIPTION
Adds a file to a ZIP archive from a given path.
PARAMETERS
o $filename
- The path to the file to add.
o $localname
- If supplied, this is the local name inside the ZIP archive that will override the $filename.
o $start
- This parameter is not used but is required to extend ZipArchive.
o $length
- This parameter is not used but is required to extend ZipArchive.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
This example opens a ZIP file archive test.zip and add the file /path/to/index.txt. as newname.txt.
Example #1
Open and add
<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
$zip->addFile('/path/to/index.txt', 'newname.txt');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>
NOTES
Note
When a file is set to be added to the archive, PHP will lock the file. The lock is only released once the ZipArchive object has
been closed, either via ZipArchive::close or the ZipArchive object being destroyed. This may prevent you from being able to delete
the file being added until after the lock has been released.
PHP Documentation Group ZIPARCHIVE.ADDFILE(3)