I got a game that output map tiles of the session with the 0,0 position at the place you login/spawn.
That makes making a map somewhat troublesome since the 0,0 will move.
So I've been looking for a way to change the numbers in the filenames of all files in a folder by a certain value.
The tiles are named "tile_X_Y.png".
I tried to use awk to get the X and Y numbers out, add the values to them and then rename the file, but are not quite sure how to manage that.
I'm not really sure how to use one awk's output as another awk's input
I have edited the code since posted.
It feels like there must be a way that's more effective than this script, and I don't really know how to get this script to work.
Thanks in advance.
Last edited by Ravenholdt; 05-17-2012 at 07:46 PM..
Probably. Reverse-engineering that script -- which I'm not sure even works, and have no way to test without your input and output -- would take a lot more time than it would starting from the input you have and the output you want, however. Could you post it?
Hmm... renaming the files around at every turn, that seems awkward...
How about you create one textfile, that will have a look-up table defining the mapping (x,y) --> png, something like:
And then you'd update this file accordingly. This way you wouldn't be dependent on the filename of pngs, and you don't need to have redundant copies of pngs if two tiles have the same image, and other advantages.
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)
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)
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)
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)
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)
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)
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,
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)
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)