LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-06-2015, 09:40 AM   #1
nileshkumar
LQ Newbie
 
Registered: Nov 2007
Posts: 21

Rep: Reputation: 0
Bulk printing of Billing files in ps (PostScript) format


I have something like 50K *.ps (PostScript) files, these are basically billing files generated from data center. Now we want to read and select files based on some aspects like
1. Billed amount greater then (say) INR 2000
2. Billing address or Pincode matches a given value

I know this can be achieved by awk and sed, the problem begins here, I Don't know how to do it, also I am almost a newbe when it comes to shell scripting, so can somebody help me in writing a script whereby I can read the files, get their filename and then pass on to printer (with lpr) to print the files.

Also, if their is already a solution to these on Linux or Windows platform, then please suggest the software also.

Last edited by nileshkumar; 03-06-2015 at 09:42 AM.
 
Old 03-06-2015, 01:05 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,071

Rep: Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088
If (like me) you're unfamiliar with awk/sed why not run ps2ascii on them, which should give you 50k text files. Then, use grep/egrep on the text files? ps2ascii comes with a few other utilities as part of ghostscript.
 
Old 03-06-2015, 03:18 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 25,806

Rep: Reputation: 7746Reputation: 7746Reputation: 7746Reputation: 7746Reputation: 7746Reputation: 7746Reputation: 7746Reputation: 7746Reputation: 7746Reputation: 7746Reputation: 7746
Quote:
Originally Posted by nileshkumar View Post
I have something like 50K *.ps (PostScript) files, these are basically billing files generated from data center. Now we want to read and select files based on some aspects like
1. Billed amount greater then (say) INR 2000
2. Billing address or Pincode matches a given value

I know this can be achieved by awk and sed, the problem begins here, I Don't know how to do it, also I am almost a newbe when it comes to shell scripting, so can somebody help me in writing a script whereby I can read the files, get their filename and then pass on to printer (with lpr) to print the files.

Also, if their is already a solution to these on Linux or Windows platform, then please suggest the software also.
There are many bash scripting tutorials you can find with a brief Google search. The ones on tldp are excellent, so start there. We can HELP you, so post what YOU have written/tried so far. But after using Linux for 8 years now, you should have some ideas.

loop through the files, and grep for a pattern. If you find it, run a command. Simple logic, and there are many example scripts you can find.
 
  


Reply

Tags
postscript, print


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postscript printing of graphics flyereddie Linux - General 0 02-07-2007 05:25 PM
postscript printing ploblem Pier Slackware 6 12-24-2005 04:56 PM
Bulk change image format apokryphos Linux - General 11 09-06-2004 04:17 PM
postscript only is printing in magenta kevinlyfellow Linux - Software 1 02-23-2004 10:59 PM
Printing Postscript file yenonn Linux - General 1 05-04-2003 11:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration