Programming :: Batch Script For All Files In Folder?

Oct 9, 2010

I have a lot of pdf files and I want to convert them to a lower quality for the web. I tried to use the following command (using ghostscript): Code: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf Is there a way to make a batch to do this for all pdf-s in a folder?

View 4 Replies


ADVERTISEMENT

Programming :: Batch Process Files In VI?

May 29, 2010

I'm completely new to scripting and I'm trying to figure out how to write a script that will get a list of all the files in a directorywn through any subdirectories.When I have the list I want to o each file in VI and change the fileformat. So far all I have been able to figure out is that VI can do the batch processing and that "ls -R" gets me the recursive file list. I'm still pretty clueless on how to do the batch process with the VI editor. I think I'm supposed to use the Ex mode but I don't know how to get the list of arguments from the filelist into the editor so they can be processed. If it matters the files were all written in a Windows editor and have gotten the MS carriage returns so I want to do a :set ff=unix command on all the files without having to go into each file manually, there are over 300 files that need updated.

View 3 Replies View Related

General :: Use Script To Batch Change File Names In Folder

Nov 9, 2009

I would like to change file names in two ways

1)
1.jpg -> 0001.jpg
2.jpg -> 0002.jpg
...
x.jpg -> 000x.jpg
...
xy.jpg -> 00xy.jpg

2)
5201.jpg -> 5001.jpg
5202.jpg -> 5002.jpg
...
5xyz.jpg -> 5(x-2)yz.jpg (where x >= 2)

View 3 Replies View Related

Programming :: Count The Files For Each Sub Folder?

Jan 11, 2011

I want to count the number of files in each sub folder of a directory structure. At the moment I can do:

ls -1R /Folder | wc -l

Which lists the item count for all the folders as one. I can do:

ls -1R /Folder wc l

Which lists all the folders in the top level and all the items. Is there any way to get the list of folders and then item count for each folder?

View 1 Replies View Related

Programming :: Monitor A Folder For New / Change Files?

Aug 30, 2010

how I can monitor a folder and get the name of newly created files or files that their size is changing? (in Perl or Linux shell script)

View 5 Replies View Related

Programming :: Bash Command To Remove All Files Within A Specific Folder?

Oct 19, 2010

I want to delete all files within a specific folder without actually deleting the folder, what is a good bash command for this?. I found this one but encountered some errors even though I am executing it within the specific folder:

useratdebian:/home/user/folder# find . -type f -exec rm -rf {} ;
[1] 5052
useratdebian:/home/user/folder# find: missing argument to `-exec'
[1]+ Exit 1 find . -type f -exec rm -rf

The command as it appears is:

find . -type f -exec rm -rf {} ;

how to delete only the files contained within the folder called "folder" for example?

View 4 Replies View Related

Programming :: Check Folder For Specific Files Than Move Script?

Nov 16, 2010

I have a script that checks a folder for zip files than moves them to a different folder. I want to check every 5 maybe 10 seconds and since cron is setup to run at least a 1 minute increment I'm not sure how to do that time check as probably a loop within the script. One other thing is once the time check is in the script how would a cron job be setup to run this script? Once the script is running cron doesn't need to run it again, is there a feature to check if it's running and if it's not then run it?

find /export/xxxshare -name "*.zip" -exec mv {} /export/store ;

View 3 Replies View Related

Programming :: Shell Script To Monitor Files Created On A Folder

Aug 27, 2009

Can someone please help me on how can i create a script that will monitor file creation on a single folder and sending the newly created file on a separate folder? Only the new created file must be transffered or copied to the other folder. The old ones remains.I urgently need this for production deployment.

View 8 Replies View Related

Programming :: Test Permissions On All Files / Folders Into A Folder Recursive?

May 16, 2010

Way to test permissions on all files/folders into a folder recursive, then if those are not user:user then do :

Code:
chown user:user thatconcernedfile

The problem with that

Code:
chown user:user -R /folder

is that it is doing changes on file permissions whihch are already ok. If you wanna maintain a specific permission on a folder this is really not good this :

Code:
while [ 1 ] ; do
chown user:user -R /folder
# /folder contains 6.0 Tb
sleep 2s
done

View 1 Replies View Related

Ubuntu :: How To Run Batch Files?

Oct 19, 2010

I recently installed JDK 6 runtime using apt-get install in terminal. I downloaded a .jar file and attempted to run it but I got an error telling me it has blocked the file for some reason.Another thing was, how can I run batch files? I know ubuntu doesn't come with something like MS DOS but is there anything similar that I can run batch files with?

View 3 Replies View Related

Fedora :: Batch Converting Of PNM Files?

Aug 27, 2010

when i scan some documents they are saved as .PNM files. what I would like is JPGs.

does anybody know any good ways of batch converting pnm files to jpeg files.

View 9 Replies View Related

Ubuntu :: Compile Batch Files In Dos?

Nov 9, 2010

Is it possible?I am mainly looking for A shell script or program that can convert a Batch (.BAT) file into a Windows executable (.EXE), or
A program that can be run from MS-DOS that can turn a batch into an exe.

View 3 Replies View Related

Programming :: How To Pause A Batch Script

Apr 7, 2011

As you already know there's a command in the "BATCH" language named pause which causes the program to get any random character and then continues the scripts (which is mostly used to keepscript running and preventing it to do its work and close the command prompt).Something like the "getch".Is there anything similar to this at bash?IMPORTANT NOTE: I don't want my script to stay opened, I want it to get a character (without hitting enter) and continue executing the rest of the script so please don't reply "Tick the keep the terminal opened option" or "Use read"

View 5 Replies View Related

Programming :: Wget Command Appropriate For Batch?

Jun 19, 2011

I have written the batch file which will go to the website, wait for input (download button/exit), move to the next algorithym and repeat. My problem is getting the batch file to click the stupid download button. Can I use wget, and can you show me how to use it or point me to a really good api?

Code:
@ECHO OFF
ECHO INSTALLING ADOBE FLASH PLAYER PLUGIN UPDATE

[code]....

View 6 Replies View Related

Fedora :: Accidentally Renamed A Batch Of Files To The Same Name?

May 26, 2010

I just did something stupid... I wanted to remove a numeric prefix from a bunch of files in a folder (EXT4 filesystem), and I ran the following Python commands to rename the files:

Code:
import os
currentdir = os.getcwd()

[code]...

View 7 Replies View Related

General :: Batch Renaming Of Files In A Directory Using Sed

Dec 11, 2010

I run a script which generated about 10k files in a directory. I just discovered that there is a bug in the script which causes some filenames to have a carriage return (presumably a '' character).

I want to run a sed command to remove the carriage return from the filenames.

Anyone knows which params to pass to sed to clean up the filenames in the manner described?

I am running on Linux (Ubuntu)

The character causing the filename to 'break up' accross multiple lines appear to be a CR (carriage return) instead of ' '. The filename is being diaplayed in thetitle of a text editor with %0D in the positions of where the file name breaks up. So I need to remove the CR chars from my filenames.

View 1 Replies View Related

Ubuntu Multimedia :: How To Batch Convert Files To .flv?

Apr 16, 2011

So I have a php script that is setup to stream flash video (.flv) and I absolutely love having it. The problem is that any files I want to stream have to be in .flv format for it to work properly as .avi and others obviously don't stream well. Up until now, I've used FFMpeg to change the format from .avi to .flv, however the process takes a lot of time if you have a lot of videos, added to that you have to do one file at a time definitely makes it a pain.Does anyone know of a bash script that can take all the files (i.e. avi, .wmv, .mkv, .mpeg4) in one folder and automatically convert it to .flv? Then possibly delete the old files? Low resolution is fine, so long as it at least viewable. Does anyone have a script or know of a program that can do this (I run Ubuntu 10.04). I think FFMpeg has the best chance of doing this, but I don't know the syntax to actually do so.

I've searched the internet, and while I have found a few scripts, they didn't work for me (still looking into two scripts I found.I am currently messing with them to see if I can get them to work).It would be immensely helpful if someone knew of a way to do this.I also forget to mention that I have used Winff, but I was looking more for a bash script to do this so that I can set a cron job to convert them every hour or so.

View 4 Replies View Related

OpenSUSE Multimedia :: 11.2 - Batch Of Codecs To Work With MKV Files

Jan 25, 2010

System - openSUSE 11.2 "Emerald" KDE (with gnome base)
Player - vlc
I'm hoping to find a batch of codecs for my newly installed openSUSE OS. I have a very troublesome collection of .mkv files that took several codec packs to make them work. For a brief explanation, I had tried haali and matroska both together and they still didn't work on certain mkvs. I ended up using CCCP, but that's win only as far as I can tell. It took the latest update of CCCP to work on all of my mkvs.

View 4 Replies View Related

General :: Renaming Files In Batch With Unix RENAME?

Mar 6, 2011

I have files whose names look like this:Sim1-2_40.36.chr20_sb.foo.indel.novoalign.samSim1-2_40.36.chr20_sb.foo.indel.bwa.samWhat I want to do is to replace all indel with snp in the namesyieldingSim1-2_40.36.chr20_sb.foo.snp.novoalign.samSim1-2_40.36.chr20_sb.foo.snp.bwa.samBut why this unix command doesn't work

View 4 Replies View Related

General :: Windows - How To Batch Rename Files With A Random Name

Jun 30, 2011

I have a bunch of photos with varying names. I want to give each photo a random name(*), how do I do that? (*)I'm going to put them on a digital photo-frame that can't shuffle

View 4 Replies View Related

Ubuntu Multimedia :: Batch Extraction Of Subtitles From Mkv Files?

Jul 16, 2011

I have recently been tasked to extract the subtitles from a lot of mkv files. Hundreds of them, maybe even more than a thousand. To do this, I modified a script I found online:

#!/bin/bash
IFS="|"
if test -z $1; then

[Code].....

So in the above example the subtitle is actually in track number one and my script would be borked for that particular file. Is there a way to integrate mkvinfo into the script and parse it to see what track should be extracted? Like, read it line-by-line and change the value of some #TRACKNO variable everytime a string like "| + Track number:" appears, and stop when a string like "| + Track type: subtitles" appears? Maybe even skip doing anything if there aren't any subtitles.

PS: I actually prefer SRT subtitles to ***. If there was some command line tool I could use to convert the resulting *** file to SRT I would be much obliged.

View 2 Replies View Related

General :: Renaming Multiple Files In Batch Process

Feb 21, 2010

I have some random files in a folder. I want to rename all of the files in a batch process. I have a text file that contains the Currentname of all the files in the folder, as well as a text file with all of the Newname of files in the folder. I want to replace Currentnames with Newnames.

For example, here are the names of the files in the folder:
1.mp4
2.mp4
3.mp4

I have a text file with the Currentname of all the files in the folder:
1.mp4
2.mp4
3.mp4

I have a text file with the proper Newname of the file:
a.mp4
b.mp4
c.mp4

I want to rename Currentname with Newname in the folder. So when I go to the folder the Newname of the files are:
a.mp4
b.mp4
c.mp4

View 14 Replies View Related

Software :: Batch-convert A Bunch Of Old Wma Files To Ogg Vorbis?

Jan 15, 2010

I'm not asking for help here, just documenting something I just discovered. Yesterday I wanted to batch-convert a bunch of old wma files to ogg vorbis. Not wanting to go through intermediate wav files, I tried to use ffmpeg to do it in one go. I first tried using the following command (in a loop, which I won't print here).

Code:
ffmpeg -i $file -f ogg -acodec vorbis -ab 192k outputdir/$file "vorbis" turns out to be the built-in libavc implementation of the codec. In the process I discovered that the -ab value is always ignored. No matter what value you put, the output is always the default 64k (average, but of course it's vbr). You can however use the poorly-documented -aq option to set the audio quality used. The values don't correspond to the oggenc values though, being a number ranging from 10-100 (or more, I don't know what the maximum is). It's not exactly clear what number corresponds to what average bitrate, so you have to experiment. ~30 seems to give you an average-rate file, while anything above 60 is probably overkill.

Switching to the external libvorbis gave me more flexibility, although at a cost of much longer encoding times (note that ffmpeg must have been compiled with libvorbis support first).

Code:
ffmpeg -i $file -f ogg -acodec libvorbis -ab 192k outputdir/$file
ffmpeg -i $file -f ogg -acodec libvorbis -aq 6 outputdir/$file

I could use both -ab and -aq (with the numbers corresponding to the oggenc values), with no problems. ffmpeg does display some wrong values in it's output text, however. In addition, there's one more difference. The vorbis (libavc) codec provides an entry in the header of the ogg container reporting the average bitrate, but it doesn't appear to provide a similar bitrate header in the vorbis stream itself. Some programs may not report the bitrate value because of this.

libvorbis provides both headers, avoiding that problem. So to summarize, libvorbis appears to be a better codec choice than vorbis.

View 10 Replies View Related

Programming :: Batch File To Run Unix Commands From Windows?

Nov 22, 2010

I need to write a windows batch file to run unix commands by logging onto a telnet unix server. For example , I might want the batch file to log onto the unix sever, run the ls command, collect the output in a file and ftp it back to my windows desktop

View 8 Replies View Related

Programming :: Convert Few Lines Of SHELL Script To DOS Batch

Apr 14, 2011

I really need help with this part of a shell script which I am trying to migrate to DOS batch script.

View 3 Replies View Related

Fedora :: A Batch Program That Reduces Size Of Jpeg Files?

Nov 11, 2009

king for a program or command line tool that ease the process of reducing size of many .jpeg files at once.I've been doing this with gimp manually by reducing jpeg quality and it's painful for 10 or 15 files to do that

View 7 Replies View Related

OpenSUSE Install :: Batch Rename Files With Special Characters?

Dec 10, 2010

I have about 300 files that need renaming, because the file system does not display the French characters properly. The dodgy letter in question has been replaced by a "question mark in a black diamond" symbol.No way of renaming, other then using mv in the Konsole has worked. Is there any way, script or program out there, that will do a batch rename?

View 9 Replies View Related

Ubuntu :: Gimp Batch Process Multiple Files Index To B&W?

Apr 15, 2010

I scanned hundreds of pages in gray scale and would like to batch process them to B&W. You can do this using the gimp GUI. what it does is get rid of all the gray shading from reflections off the paper when scanned. So you get crisp white backgrounds with black text and diagrams. I would like to simply do this to the entire group directory at one time as it would be quite a lot of effort to open them and do them one by one.

View 3 Replies View Related

Ubuntu Multimedia :: Batch Convert Audio In Video Files?

May 8, 2010

a movie is encoded with AC3 in 6 channel audio, what I get out is all of the sounds except for voices, which in 5.1 would be sent to the center channel. What I usually do is fire up avidemux and convert the audio to mp3 stereo, as converting to a 5.1 format usually ends up with a very odd sound (like running everything through an echo chamber). What I'd like to do is run a script to batch-convert these files from AC3 to MP3. The video format may vary, but they are usually XVID. I am comfortable at the command line, but I am not well-versed in audio/video tool terms. I don't need anything extravagant, I just want something that works. Heck, even if it is done one at a time, having a shell script that I can use to simply type:

tool.sh inputfile.avi outputfile.avi

View 4 Replies View Related

Ubuntu :: Mega Batch Files To Rename - Includes Sub Folders

Oct 20, 2010

I have quite a few sound sample files totaling over 4 gigs in size with around 80 root folders and then around 34 sub folders. i have a total of 13 DVD's in the above format. how do i "change the date" on all files in one go is that possible?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved