Unix Program for data and print


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Unix Program for data and print
# 1  
Old 02-28-2002
Unix Program for data and print

Hi
Is there any UNIX program (or Mac OSX) that works with delimitted data files, manipulates the data into a letter / layout form and can then send multiple personalised forms to multiple printers? If this is not the right forum, can anyone point me in the right direction?
Thanks
Mike Taylor
# 2  
Old 03-01-2002
You could write a script to do this...
It's hard to say for sure, though, with so little information.
# 3  
Old 03-06-2002
The way the problem was stated, it sounded like 'mailmerge' - this is a part of most word processors -??

Is this an example:

@list = ('atle', 'per', 'geir');

@letters = ('intro', 'invoice', 'request');

And then, you exmine the status of each element in the list, determine whether they should get an 'intro', 'invoice' etc. (or 'nothing' !!!) and the contents of each letter is then filled in with 'name' 'address' etc in the style of

Dear $firstname if it is an informal letter

Dear $title $lastname if it is a request for money, etc.

This is something StarOffice is very good at.
But I think other 'office' applications like koffice are getting up to the task as well?

Atle
# 4  
Old 03-13-2002
Hmmm ... I am not sure what he is asking for ? I am curious, miketaylor can you be kindly more specific ? I dont know what you mean by a delimited data file ? Example ? What would the delimiter signify ?
# 5  
Old 03-13-2002
I think we lost miketaylor here, this post has been up for a while.
When I responded to it, I assumed a delimited data file to be an ASCII file where the 'delimiter' signified end-of-field, and where newline signified end-of-record, these things are very common in the DOS world, but not unseen in our world, either :-)
Comma-delimited qouted strings (typical export file)

"Hacker","A.Genius","Main St.","Unic City","41"
"Hacker","J. Random","Back St. 2","Dosburg","69"
"Hacker","N.A","","Weirdlayout"

Here is a colon-delimited data file

nobody:x:60001:60001:Nobody:/:
fbsdd00d:x:500:500:Admin:/home/fbsdd00d:/bin/sh

So, the program would typically read one line at a time, filling in a struct each time, and calling some program.

This can also be used for very evil things, like
spamming, but that was not what the OP wanted to do, I just show it to show off my newly aquired Perl-newbie status and possible faulty understanding or the problem.
Code:
#!/usr/bin/perl
$FIL = "/etc/passwd"
open FIL or die "Try that again and you die 4 real";
# Write a nice letter to each member
# of mailing list
while(<FIL>) {
	@Line = colon-delimited-list
	printf("Dear %s!\n", @Line[4]);
	printf("You were referred to me by your /etc/passwd file ...");
	...
}
close(FIL);

Atle

added code tags for readability --oombera

Last edited by oombera; 02-20-2004 at 02:17 PM..
# 6  
Old 05-21-2002
yeah u can do wht u want using shell programming implementing cut or perl would be a much better option to use in solving these things...
hope u would be doing better now by having so many feedbacks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to send data to previous program (pipe)?

Hi, Suppose I have a command:$ cmd1 | cmd2I need to send a message from cmd2 to cmd1 when I receive some a certain message from cmd1. How to do this? I think that I have to know cmd1's PID and then in cmd2 send a message to this PID. How? (24 Replies)
Discussion started by: JackK
24 Replies

2. Programming

Program wont print prime numbers

The problem I'm having is that when you put in the two numbers the answer is just prime.... nothing. I cannot figure this out ive been working on this forever, can someone please god just tell me how to fix this without encrypted "hints". #include <iostream> #include <cmath> using... (3 Replies)
Discussion started by: c++newb
3 Replies

3. Homework & Coursework Questions

program to find and print a Fibonacci sequence of numbers. --Errors

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am trying to convert a C language program over to Sparc Assembley and I am getting Undefined first referenced... (4 Replies)
Discussion started by: kenjiro310
4 Replies

4. Linux

Perl program to print previous set of lines once a pattern is matched

Hi all, I have a text data file. My aim here is to find line called *FIELD* AV for every record and print lines after that till *FIELD* RF. But here I want first 3 to four lines for very record as well. FIELD AV is some where in between for very record. SO I am not sure how to retrieve lines in... (2 Replies)
Discussion started by: kaav06
2 Replies

5. Shell Programming and Scripting

Linux:Program exit with displaying a print feature

hi All I have a scritp running which connects to a local host and then gets a value from a field and then ftp that value to antoher server. It is running fine, and from crontab it gives the output to a file, the problem is sometime it doesnt run but if i check the output file it does not show one... (0 Replies)
Discussion started by: imran721
0 Replies

6. Programming

Change Pseudo Code to C Program (print and fork)

I am very new at programming and this is probably an easy question, but I am desperate. I need to change this low level code into a C program that I can run so I can print out every "A" that appears with the fork() command. You help is greatly appreciated. PRINT A p=fork() if( p == 0) {... (0 Replies)
Discussion started by: tpommm
0 Replies

7. Shell Programming and Scripting

Program for pairing together to print outputusing perl

Suppose u have One file one row and one column A1 A2 A3 A4 A1 A2 A3 A4 And another Second file shows pairing A1 A4 A2 A3 A2 A4 A1 A3 Want the output to be like based on the pairing .. As seen from the second fileThose who are paired will get one A1 A4 will... (2 Replies)
Discussion started by: cdfd123
2 Replies

8. Shell Programming and Scripting

submitting data during a program run

I'm new to this and didn't know what my problem is called but here it is: A program called "prepdata" is run which asks the user to enter in a <input> file for the data to be taken from. However, it won't accept that input filename as an argument: $ prepdata <input> will NOT work ... (2 Replies)
Discussion started by: Rob W
2 Replies

9. HP-UX

Print Problem in UNIX. Need to know the option to specify the print paper size

Hi, Could any one please let me know what is the option available in UNIX to print by specifying the paper size? We are using Unix11i. I could n't see any option specified in the 'lp' command to print the report by specifying the size of the paper. It would be of great help to me, if... (1 Reply)
Discussion started by: ukarthik
1 Replies

10. Programming

may be simple but i don't know -- Print current date from C program

How to print current date of the Unix system accessing thru C++ program ? I wrote like this #include <time.h> ....... time_t tt; struct tm *tod; .... time(&tt); tod = localtime(&tt); cout << tod->tm_mon + 1 << "/" << tod->tm_mday << "/" ... (6 Replies)
Discussion started by: ls1429
6 Replies
Login or Register to Ask a Question