[ start | index | login ]
start > Virtual Brain > Linux > Mover Filerename Script

Mover Filerename Script

Created by stefan. Last edited by stefan, 7 years and 66 days ago. Viewed 727 times. #1
[edit] [rdf]
labels
attachments
#!/bin/bash
#
# Script copies unordered files from src dir to ordered
# files in destdir. File names generated by simple counter.
# Src File names extracted from html file that contains
# the correctly ordered list.
#
# 2004-12-06, stefanrufer.ch

# extract src filenames from html file. html contains filenames in correct order LIST=`cut --delimiter=" --fields=11 index.html | grep jpg` # echo $LIST

DEST_DIR=dest SRC_DIR=images

# clear destination directory rm $DEST_DIR/*

# start counter high enough so we don't need leading zeroes CNT=1000

# copy loop for SRC_FILE in $LIST do echo copying $SRC_DIR/$SRC_FILE to $DEST_DIR/$CNT.jpg cp $SRC_DIR/$SRC_FILE $DEST_DIR/$CNT.jpg # counting in bash - didn't know this before let CNT=$CNT+10 done

no comments | post comment
search www.stefanrufer.ch
Google

Content

Me?


Blog Calendar

< February 2012 >
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
26272829

Weblog summary 2007, 2006, 2005, 2004


Content managed by SnipSnap

M

snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt