Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find and replace mulitple charaters in filenames Post 302758477 by Don Cragun on Saturday 19th of January 2013 05:07:09 PM
Old 01-19-2013
Quote:
Originally Posted by barrydocks
Thanks for the replies.



Yes you are probably correct, creation date would probably be the best.

@Don Cragun
Thanks for your advice, unfortunately most of it is completely over my head - hence why I post on here for help - I am not an IT professionalSmilie

The idea is that a pdf will be produced by front-of-house staff from a word document that is populated from an MS Access applicationSmilie using a virtual cups-pdf printer on my ubuntu server. The pdf will then need to have the characters added by the pdf printer removed, the creation date added and moved to a new directory. From the new location the pdf will be edited by a user (me) on a tablet pc (probably an iPadSmilie) and then attached back to the MS Access record. I was planning to run the script that alters the pdf filename every 30secs or so as a cron job from a unprivileged user home directory. Hopefully this all makes sense?

I am open to better suggestions if you have anySmilieSmilie

Thanks
OK. Back to basics:
1. Will all of the files you want to rename be in the same directory? If so, what is the name of that directory? If not, what are the names of all of the directories that will contain pdf files you want to rename?
2. What is the name of the directory where you want to place the renamed pdf files?
3. When you run the command:
Code:
uname -a

what is the output?

If you want a script to run every 30 seconds, cron won't be sufficient; its finest granularity is 1 minute. And, if the system is busy, you could end up having two copies of your script running at the same time. If you run a script to rename files every few minutes after a file is converted, the likelihood that the current date and the file's creation date are different is pretty low (especially if the front end people who create the pdf files don't work between 11pm and 1am).
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find lowercase filenames

How do I write the command to find all files with any lower case letters in the filename? I have tried find . -name *\(a-z\) and a lot of combinations like that, without success. thanks JP:confused: (4 Replies)
Discussion started by: jpprial
4 Replies

2. Shell Programming and Scripting

find filenames like unix commands

Hi, I need to write a small script to search in some specific directories to check if any file is present with a unix command name... Means if the directory contains any files like cat, vi, grep, find etc i need to list those files into a file. Please help Thanks, D (6 Replies)
Discussion started by: deepakgang
6 Replies

3. Solaris

feeding filenames to find command

Hi, I am having set of files whose names are stored in a file say "filelist.txt" Now, I want to find all files contained in "filelist.txt" from my parent directory. Is there any way to let find command understand "filelist.txt" just like we have option -f in awk. I donot want to run a... (4 Replies)
Discussion started by: sanjay1979
4 Replies

4. Shell Programming and Scripting

Help with Find/Replace Javascript Injected Strings in mulitple files

Hi, guys, I'm not a high-end programmer, but I've been trying to write a script to remove all of the b.rtbn2.cn (and b.adserv.cn and any future variation) injected script tags on the server. (Still working on security fixes to prevent it in the future, just need to clean up now.) My approach is... (1 Reply)
Discussion started by: zzlegs
1 Replies

5. Shell Programming and Scripting

Find duplicate filenames and remove in different mount point

Hi Gurus, Do any kind souls encounter have the same script as mentioned here. Find and compare filenames in different mount point and remove duplicates. Thanks a million!!! wanna13e (7 Replies)
Discussion started by: wanna13e
7 Replies

6. Shell Programming and Scripting

awk help with find command and filenames with spaces

I have the following code: find /usr/local/test5 -type f -mtime +30 -exec ls -l {} \; | awk '{print $5, $6, $7, $8, $9}' I have this as output: 14 Aug 12 00:00 /usr/local/test5/file1 14 Aug 12 00:00 /usr/local/test5/lastname, The bolded part is where I run into trouble. The actual... (4 Replies)
Discussion started by: streetfighter2
4 Replies

7. UNIX for Advanced & Expert Users

replace word with special charaters

I have input file called file1 with characters that have \\ in it. I cannot change input file, because it is generated earlier in script. Now would like to replace string on line in file called bfile with output from file1 I have been using sed command. $cat file1 pc//6sPxp== $ cat scr1... (4 Replies)
Discussion started by: drtabc
4 Replies

8. UNIX for Dummies Questions & Answers

find & remove characters in filenames

I have a group of files in different directories with characters such as " ? : in the file names. How do I find these files and remove these characters on mass? Thanks (19 Replies)
Discussion started by: barrydocks
19 Replies

9. UNIX for Dummies Questions & Answers

Find the list of filenames that have the string 31 at 4th and 5th position

Hi, Can anyone let me know the command to know the list of filenames that have string 31 in their 4th and 5th positions inside the file: grep -l "31" main*.txt The above grep lists all the files which have 31 at any position but I want filenames having 31 at position 4 and position 5. (8 Replies)
Discussion started by: okkadu
8 Replies

10. Shell Programming and Scripting

How to append timestamp in the filenames using find?

Hi, How to change the filenames with timestamp in sub folders I have the following code to select the records. find . -type f -name '*pqr*' -ctime 1 -print The following is the example app_root_dir="/`echo $ScriptDir | cut -d'/' -f2`" $app_root_dir/../BadFiles directory uvw.bad... (3 Replies)
Discussion started by: bobbygsk
3 Replies
cupsfilter(8)							    Apple Inc.							     cupsfilter(8)

NAME
cupsfilter - convert a file to another format using cups filters SYNOPSIS
cupsfilter [ --list-filters ] [ -D ] [ -U user ] [ -c config-file ] [ -d printer ] [ -e ] [ -i mime/type ] [ -j job-id[,N] ] [ -m mime/type ] [ -n copies ] [ -o name=value ] [ -p filename.ppd ] [ -t title ] [ -u ] filename DESCRIPTION
cupsfilter is a front-end to the CUPS filter subsystem which allows you to convert a file to a specific format, just as if you had printed the file through CUPS. By default, cupsfilter generates a PDF file. The converted file is sent to the standard output. OPTIONS
--list-filters Do not actually run the filters, just print the filters used to stdout. -D Delete the input file after conversion. -U user Specifies the username passed to the filters. The default is the name of the current user. -c config-file Uses the named cups-files.conf configuration file. -d printer Uses information from the named printer. -e Use every filter from the PPD file. -i mime/type Specifies the source file type. The default file type is guessed using the filename and contents of the file. -j job-id[,N] Converts document N from the specified job. If N is omitted, document 1 is converted. -m mime/type Specifies the destination file type. The default file type is application/pdf. Use printer/foo to convert to the printer format defined by the filters in the PPD file. -n copies Specifies the number of copies to generate. -o name=value Specifies options to pass to the CUPS filters. -p filename.ppd Specifies the PPD file to use. -t title Specifies the document title. -u Delete the PPD file after conversion. EXIT STATUS
cupsfilter returns a non-zero exit status on any error. ENVIRONMENT
All of the standard cups(1) environment variables affect the operation of cupsfilter. FILES
/etc/cups/cups-files.conf /etc/cups/*.convs /etc/cups/*.types /usr/share/cups/mime/*.convs /usr/share/cups/mime/*.types NOTES
Unlike when printing, filters run using the cupsfilter command use the current user and security session. This may result in different out- put or unexpected behavior. EXAMPLE
The following command will generate a PDF preview of job 42 for a printer named "myprinter" and save it to a file named "preview.pdf": cupsfilter -m application/pdf -d myprinter -j 42 >preview.pdf SEE ALSO
cups(1), cupsd.conf(5), filter(7), mime.convs(7), mime.types(7), CUPS Online Help (http://localhost:631/help) COPYRIGHT
Copyright (C) 2007-2017 by Apple Inc. 11 June 2014 CUPS cupsfilter(8)
All times are GMT -4. The time now is 05:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy