Sponsored Content
Top Forums Shell Programming and Scripting increase/decrease multiple numbers in a filename. Post 302642627 by Chubler_XL on Thursday 17th of May 2012 07:45:48 PM
Old 05-17-2012
Try this (remove echo when your confident it's going to do what you want):

Code:
#!/bin/sh
v1c=5
v2c=-5
cd ./tiles
for tile in *
do
  echo mv $tile `echo $tile | awk -vv1=$v1c -vv2=$v2c -F[_.] '{print $1 "_" $2+v1 "_" $3+v2 ".png" }'`
done

This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to change filename with numbers

ok, this one is definitely too hard for my shell-script-skills. Hopefully, there is somebody who can help me with this: I have a folder with files in it named 0.ppm 10.ppm 2.ppm ... 5.ppm 50.ppm 55.ppm ... 355.ppm 360.ppm etc. As you will notice, the order in which the files are... (5 Replies)
Discussion started by: silversurfer202
5 Replies

2. Solaris

increase/decrease filesystem

Hi All, I need to increase the filesystem of / and /var (two different slices)? Space will be coming from /home slice so I need to decrease it. Is that possible without reinstallation or in a single-user-mode? Any idea or link please. Thanks in advance. (5 Replies)
Discussion started by: itik
5 Replies

3. Shell Programming and Scripting

rename multiple filename.45267.txt to >> filename.txt

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)
Discussion started by: jason7
6 Replies

4. Shell Programming and Scripting

delete numbers in a filename

I have some files where numbers are part of like eg 1add1.txt 23sub41.txt etc I want to remove numbers from the filenames(whereever it may be). I used echo `ls *.txt | sed -e "s///"` But its removing first digits like 1add1.txt becomes add1.txt My intention is to make 1add1.txt... (3 Replies)
Discussion started by: villain41
3 Replies

5. Solaris

How to increase Inode numbers in Solaris 10

Hi guys, need your help on this since i dont know much about solaris. the problem is i need to increase inodes space on /export/home/ root@BRF-DANCCM1 # /usr/ucb/df -i Filesystem iused ifree %iused Mounted on /dev/vx/dsk/bootdg/rootvol 53026 1162206 ... (7 Replies)
Discussion started by: ichiko
7 Replies

6. Shell Programming and Scripting

How to remove numbers from filename

Hi all, Can I edit this script: find . -type f | while read i;do && mv "$i" "${i//abc/}" ;done so that it will not only take out abc from the filename but also take out any numbers that might be in the filename as well. An example would be, Input: filename abc 2009.mov Output:... (7 Replies)
Discussion started by: Monkey Dean
7 Replies

7. Solaris

How to increase or decrease inode number of the particular UFS filesystem

Hi Gurus I want to know the command & tips regarding, how to increase or decrease inode number of the particular ufs filesystem. Is it possible to do it in a live/production environment. Regards (3 Replies)
Discussion started by: girish.batra
3 Replies

8. Shell Programming and Scripting

Awk : find progressive increase in numbers

NR_037575 -0.155613339079513 -0.952655362767482 -1.42096466949375 -0.797042023687969 -1.26535133041424 -0.468309306726272 NR_037576 0.59124585320226 0.408702582537126 0.888885242203586 -0.182543270665134 0.297639389001326 0.480182659666459... (4 Replies)
Discussion started by: quincyjones
4 Replies

9. Fedora

How to increase/Decrease Local Virtual consoles?

I m tring to figure out the option where i can increase/Decrease the count for local virtual consoles(vtys). I can able to take upto 6 vtys using (left alt+(F1-F6)) But is there any way i can increase the count ? One more query even though i can only take tty upto tty6 why there are tty... (2 Replies)
Discussion started by: pinga123
2 Replies

10. Shell Programming and Scripting

Renaming file that has multiple numbers as filename

Hi I have a file with filename as "partition-setup-and-ipl.vtcmd.76217657132.9721536798" Now i need to move this file as "partition-setup-and-ipl.vtcmd.76217657132.9721536798_org" i tried with # ls | grep -E "partition-setup-and-ipl.vtcmd.+"... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
TIFFReadRawTile(3T)													       TIFFReadRawTile(3T)

NAME
TIFFReadRawTile - return an undecoded tile of data from an open TIFF file SYNOPSIS
#include <tiffio.h> tsize_t TIFFReadRawTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size) DESCRIPTION
Read the contents of the specified tile into the (user supplied) data buffer. Note that the value of tile is a ``raw tile number.'' That is, the caller must take into account whether or not the data is organized in separate planes (PlanarConfiguration=2). TIFFComputeTile automatically does this when converting an (x,y,z,sample) coordinate quadruple to a tile number. To read a full tile of data the data buf- fer should typically be at least as large as the value returned by TIFFTileSize. RETURN VALUES
The actual number of bytes of data that were placed in buf is returned; TIFFReadEncodedTile returns -1 if an error was encountered. DIAGNOSTICS
All error messages are directed to the TIFFError(3T) routine. SEE ALSO
libtiff(3T), TIFFOpen(3T), TIFFReadEncodedTile(3T), TIFFReadTile(3T), TIFFTileSize(3T) October 15, 1995 TIFFReadRawTile(3T)
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy