Renaming script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Renaming script
# 15  
Old 12-11-2002
I'm sorry to hear that you are having trouble - I tried my script at work on my Win98 box and it still works for me.

Could you tell me how you are copying the text for the script above? Copy and paste? Are you saving it as a "plain text" file?
# 16  
Old 12-11-2002
Ok I realized why I got those errors. I copied the script incorrectly from the post...including the line:
code:--------------------------------------------------------------------------------

The next line of actual code was
$trackFolder = "c:\\temp\\ptmp"; #or whatever you set it to

so perl thought I was trying to pre-decrement the variable $trackfolder. If you comment out the first line, the script will work.

Last edited by dangral; 12-11-2002 at 12:46 PM..
# 17  
Old 12-11-2002
yea, i got no errors. but nottings happed to the file in my folder.When i run it. i get .....testfile.txt (thats the name of the file in the folder) but notting else happens
# 18  
Old 12-11-2002
perleo,

How exactly are you running it? What command are you using?
# 19  
Old 12-12-2002
running it from windows.i have perl builder. saved it as rename.pl and go to run it from windows explorer and thats what happens
# 20  
Old 12-12-2002
Have you tried running it from the command line? Try it like this:

perl rename.pl
# 21  
Old 12-14-2002
yea, got it.thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script for batch renaming

What is wrong with this script to rename batch of similar files? For example renaming all *.txt files to *.tab . $ for i in seq {01..10}; do touch ${i}.txt; done $ ./rename.sh *.txt txt tab Error: mv: ‘01.txt’ and ‘01.txt’ are the same file. Code is: #!/usr/bin/bash # renames.sh #... (6 Replies)
Discussion started by: yifangt
6 Replies

2. Shell Programming and Scripting

Cronjob script not renaming file

Hello, I have below script, which connects to ftp server, pull a file and then it renames it after deleting previous day file. This was working before but now it is not able to rename 'Red_bill.txt' to `Red_bill.V01.txt`. If I run manually 'rename Red_bill.txt Red_bill.V01.txt', I am able to... (5 Replies)
Discussion started by: solaris_1977
5 Replies

3. UNIX for Dummies Questions & Answers

Script for renaming multiple scripts

Hi There I am looking at writing a script that I can run from a cron job (say every month) that will copy my existing scripts to another folder, then in THAT new folder, append them all with the extension of .txt I have the cp command down pat (cp /existing_folder /new_folder) however I am... (6 Replies)
Discussion started by: orangepeel
6 Replies

4. Shell Programming and Scripting

Script help required in renaming

Given a directory containing 10 files: 1 - abcd1.txt 2 - abcd2.txt . . 10 - abcd3.txt 1 )Write a one liner sh script* to rename all files that start with a number less than 10, to have a zero in front. ie. 1 - abcd1.txt will be renamed to 01 - abcd1.txt. * You may not make use... (1 Reply)
Discussion started by: learnbash
1 Replies

5. Shell Programming and Scripting

Copying and Renaming script

Hey all! Sorry for the noobish question.. I am wondering how to I copy multiple files, and rename them based on their directory at once. So, I have files like this /logs/server/2011-10/server-1/log/file/folder/some.log.gz /logs/server/2011-10/server-2/log/file/folder/some.log.gz... (3 Replies)
Discussion started by: m3power206
3 Replies

6. Shell Programming and Scripting

Need script for renaming and moving files one by one...

Dears, I need your help! I got a problem and found some workaround solution but I donno how to realize it. I have a number of files (about 300 each day) and I need them to be renamed. All these files has fixed number of letters and name looks like this one:... (7 Replies)
Discussion started by: nypreH
7 Replies

7. Shell Programming and Scripting

Script for renaming files

I wanna back up the original version of files in a directory by appending .ORIG to them. I'm guessing I'd need CP and AWK in some form or fashion. Can someone give me a template? Thanks (3 Replies)
Discussion started by: stevenswj
3 Replies

8. Shell Programming and Scripting

script for renaming a batch of files

hi i have a folder full of files. some of the names are quite off because the dimensions were the same and i had to put a 'b' after the initial number so that it didnt overwrite. what i want is a script in unix to overwrite the filwe name leaving some of the title intact, e.g. below are some... (3 Replies)
Discussion started by: shabs1985
3 Replies

9. UNIX for Dummies Questions & Answers

Renaming Files using Shell Script

Hi Gurus, I have some files(all ending with .out as extension). Ex: aa1.out aa2.out aa3.out I would like to append each file with the current date to the end of the file so that they should become aa1_20090504.out. So I am using rename as follows: for i in path/aa* ; do mv $i... (5 Replies)
Discussion started by: asmfloyd
5 Replies

10. Shell Programming and Scripting

Renaming files in a bash script

I'm doing a short batch script to compile po files producing output binary mo files. The compilation command is: msgfmt -o file.mo file.po so in order to compile I am appending .mo to the varible in a loop. It goes something like this: for i in `find . -name "*.po"` do echo... (2 Replies)
Discussion started by: Breen
2 Replies
Login or Register to Ask a Question