Sponsored Content
Top Forums Shell Programming and Scripting renaming 50k files, whats the best way? Post 95619 by r0sc0 on Thursday 12th of January 2006 05:06:16 PM
Old 01-12-2006
renaming 50k files, whats the best way?

Because I am not creative, I did this:
find . -type f -name '*.GIF'|cut -d'/' -f2|awk -F. '{print "mv "$1".GIF "$1".gif --reply=yes"}' > case.sh

Then ran the case.sh - I was wondering if you guys could come up with something more efficient? Or even limit CPU useage? It is killing my poor ext3 linux server.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: sorting files by whats in'em

i'm halfway into my script and realize i may need to use an associative array (a hash, i guess they are called in Perl). i'm fairly new to Perl and don't know how to use them correctly. i have some files in a directory. each file contains a number in a specific place in it's header. what i would... (4 Replies)
Discussion started by: quantumechanix
4 Replies

2. Shell Programming and Scripting

renaming Files

Renaming Files more than 1000 in Diffrent Directories in system.. help me in this issue to resolve.... (5 Replies)
Discussion started by: sunsap
5 Replies

3. UNIX for Dummies Questions & Answers

Need help renaming files

I just can't figure this one out. I have a lot of files name (for example) ABC1234.5678.ext I need to rename these files U0105678PQRS So I'm removing everything before the first "." I'm keeping "5678" in the file name Adding "U010" to the front of "5678" Dropping the ".ext" extension ... (5 Replies)
Discussion started by: bbbngowc
5 Replies

4. Shell Programming and Scripting

renaming files or adding a name in the beginning of all files in a folder

Hi All I have a folder that contains hundreds of file with a names 3.msa 4.msa 21.msa 6.msa 345.msa 456.msa 98.msa ... ... ... I need rename each of this file by adding "core_" in the begiining of each file such as core_3.msa core_4.msa core_21.msa (4 Replies)
Discussion started by: Lucky Ali
4 Replies

5. Shell Programming and Scripting

Renaming files

Can someone please help. Much appreciated!! I have 4 directories, for ex... /RUN1/ReportTable.nxt /RUN2/ReportTable.nxt /RUN3/ReportTable.nxt /RUN4/ReportTable.nxt I would like to write a for loop, to add the directory name to each ReportTable.nxt I would like for it to be: ... (5 Replies)
Discussion started by: dirttysoufff
5 Replies

6. UNIX for Dummies Questions & Answers

Renaming Files

I just used wget to obtain a bunch of html documents. Now they are named index.html, index.html.1, index.html.2, etc. I'd simply like to move the 1, 2, 3 etc. to the left before the .html, so the new names would be: index1.html, index2.html etc. I know this can be done with a simple script, but... (2 Replies)
Discussion started by: crl21
2 Replies

7. Shell Programming and Scripting

Finding 50k Keywords in 3k files

Hi, I have a file with about 50k keywords. I have a requirement to scan about 3k files to identify which filename has which keyword i.e. an output like following: File1,Keyword1 File1,Keyword2 File3,Keyword1 ..... I have written a shell script which takes each of the 3k files, searches... (4 Replies)
Discussion started by: rjains
4 Replies

8. Shell Programming and Scripting

Renaming files

Hello, I am looking for a command line that will rename name files : f700_abc_o_t_MASTERID_AS_AE_20130323.csv like this f700_abc_o_t_MASTERID_AS_AE_20130324.csv The great idea could be to get the date stamp 20130323 and change any part of it, instead of just change the... (4 Replies)
Discussion started by: Aswex
4 Replies

9. UNIX for Dummies Questions & Answers

Help with renaming the files.

Hi, I have 31 file as below.... dt_ref_med_merged_madt_h_19980101.nc .. .. dt_ref_med_merged_madt_h_19980131.nc I want to rename it like... dt_ref_med_merged_madt_h_1998_1.nc .. .. dt_ref_med_merged_madt_h_1998_31.nc How can I do it ? any suggestions ? I want to do it small... (5 Replies)
Discussion started by: mahesh shinde
5 Replies

10. Shell Programming and Scripting

Renaming multiple files in sftp server in a get files script

Hi, In sftp script to get files, I have to rename all the files which I am picking. Rename command does not work here. Is there any way to do this? I am using #!/bin/ksh For eg: sftp user@host <<EOF cd /path get *.txt rename *.txt *.txt.done ... (7 Replies)
Discussion started by: jhilmil
7 Replies
IMAGECREATEFROMGIF(3)							 1						     IMAGECREATEFROMGIF(3)

imagecreatefromgif - Create a new image from file or URL

SYNOPSIS
resource imagecreatefromgif (string $filename) DESCRIPTION
imagecreatefromgif(3) returns an image identifier representing the image obtained from the given filename. Tip A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen(3) for more details on how to specify the filename. See the "Supported Protocols and Wrappers" for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide. PARAMETERS
o $filename - Path to the GIF image. RETURN VALUES
Returns an image resource identifier on success, FALSE on errors. EXAMPLES
Example #1 Example to handle an error during loading of a GIF <?php function LoadGif($imgname) { /* Attempt to open */ $im = @imagecreatefromgif($imgname); /* See if it failed */ if(!$im) { /* Create a blank image */ $im = imagecreatetruecolor (150, 30); $bgc = imagecolorallocate ($im, 255, 255, 255); $tc = imagecolorallocate ($im, 0, 0, 0); imagefilledrectangle ($im, 0, 0, 150, 30, $bgc); /* Output an error message */ imagestring ($im, 1, 5, 5, 'Error loading ' . $imgname, $tc); } return $im; } header('Content-Type: image/gif'); $img = LoadGif('bogus.image'); imagegif($img); imagedestroy($img); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : Example to handle an error during loading of a GIF NOTES
Note GIF support was removed from the GD library in Version 1.6, and added back in Version 2.0.28. This function is not available between these versions. Note When reading animated GIF files into memory, only the first frame is returned in the image resource pointer. PHP Documentation Group IMAGECREATEFROMGIF(3)
All times are GMT -4. The time now is 02:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy