Report printing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Report printing
# 8  
Old 01-27-2013
Hi. This is what i did.

Code:
declare -rx file="alphanum.txt
declare -i alpha1
declare -i alpha2
declare -i num1
declare -i num2

while IFS=: read num1 num2 alpha1 alpha2 junk; do
printf "%-12d%12d%12s%12s\n" "$num1" "$num2" "$alpha1" "$alpha2" 
done < $file

just found out what went wrong. i declare -i alpha1 and alpha2.

Last edited by One_2_three; 01-27-2013 at 11:44 AM..
# 9  
Old 01-27-2013
Sorry, I should also have asked that you to say what "$file" is set to, and post the contents for that file.

And there's no point in using %d unless you plan to format it specially, i.e. with leading zeros, so change those to %s.
# 10  
Old 01-27-2013
Hi. Sorry. i left out my declaration. i have edited my code posted already.
# 11  
Old 01-27-2013
Yes, please include all relevant code. It could save people time Smilie

And where would the closing quote to this be:
Code:
declare -rx file="alphanum.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Printing, SYSPRINTER, IP printing

Dear readers, We have a printer problem with a UNIX system. The OS is Unix IRIX 6.5 We have connected a printerto the system. If we then make a test print everything goes well . (IP printing) But if we make a print from the "orrga,i"program. Then we see all the printouts stuck within the... (3 Replies)
Discussion started by: SergevdH
3 Replies

2. Shell Programming and Scripting

Why its printing like this?

Hi, when i use the following awk i will get the output like double time printed values and the 2nd time only its giving data, please help me to find this for ex: awk code: file_name=$1 file_name1=$2 ctn=$(awk 'FNR==NR{a=$4;}$2 in a{t=a-$4;print $2,(FNR==1)?"":t"@"}' ${file_name}... (3 Replies)
Discussion started by: Shenbaga.d
3 Replies

3. UNIX for Dummies Questions & Answers

Sco Unix printing : jobs hangs in queue - printing via lp versus hpnpf

Hi, We have a Unix 3.2v5.0.5. I installed a printer via scoadmin, HP network printer manager with network peripheral name (hostname and ipadres are in /etc/hosts). This is the configuration file : Code: root@sco1 # cat configurationBanner: on:AlwaysContent types: simpleDevice:... (0 Replies)
Discussion started by: haezeban
0 Replies

4. Windows & DOS: Issues & Discussions

Linux to Windows Printing: PDF starts printing from middle of page.

We are using Red Hat. We have a issue like this: We want to print from Linux, to a printer attached to a Windows machine. What we want to print is a PDF. It prints, but the printing starts from the middle of the page. In the report, there is no space at the top but still printing starts from the... (5 Replies)
Discussion started by: rohan69
5 Replies

5. Shell Programming and Scripting

Generating a report -Formatted printing -Urgent

Hi, My aim is to generate a report using shell script. There are various formats fields coloumns etc. I want to print in a single line (row) but in different coloumn as given below: field1 field2 field3 field4 ....... ....... ...... ....... The spacing... (1 Reply)
Discussion started by: jisha
1 Replies

6. UNIX for Advanced & Expert Users

printing \n

Hi all, In a script I need to print a string: print "\n"; but i am not able to print the above mentioned string... Please help. Regards Rochit (5 Replies)
Discussion started by: rochitsharma
5 Replies

7. Shell Programming and Scripting

Printing

Hey, I'm trying to print in HP laserjet 2420 by using the command: lp -olandscape (file) For some reason it does not come out as landscape but as portrait. Help please. 10x. P.S. I'm using csh (0 Replies)
Discussion started by: Kofiko
0 Replies

8. UNIX for Dummies Questions & Answers

Printing

How do I configure a UNIX printer to print to a Windows PC with vt320 emulation (0 Replies)
Discussion started by: sowlix
0 Replies

9. UNIX for Advanced & Expert Users

Printing Problems in unix ... ( Bar-cdoe - Ip Printing)

Hi guys ... i need ur help with some printing problem in unix ... first prob. : i wanna print from my NCR unix to an Win NT , Ip based printing server ( HP JetDirect ) . My issue , is it possible to print directly to an Ip address from unix ? How do i make it work to get any results ?... (3 Replies)
Discussion started by: QuickSilver
3 Replies

10. UNIX for Dummies Questions & Answers

Printing

Do all UNIX systems have the ability to print to an ASCII file? If so, is this a common thing to do, for reports or other output? Thank you for your response. (3 Replies)
Discussion started by: SYMTRAX
3 Replies
Login or Register to Ask a Question