Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Group sums by matching and then multiplying by weights Post 302935823 by ritakadm on Thursday 19th of February 2015 10:52:59 AM
Old 02-19-2015
Thanks a lot to both of you,, I`m getting different answers for your scripts,, does the data need to be sorted for any or both?

Update

It was the \r that was messing it up....thanks a lot...

Last edited by ritakadm; 02-19-2015 at 12:34 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cmos check sums

not entirely unix orientated but.... anyway i've got an old 486dx? 100 that i'll looking to turn into a unix running machine. But everytime i turn it on it comes up with and invalid CMOS checksum, after i've been into the set up and reset that it works fine, tried a new batter and that didn't sort... (1 Reply)
Discussion started by: stevox
1 Replies

2. UNIX for Dummies Questions & Answers

Doing sums

Let me explain my problem, I have a file in the following format 9602622 - User ID 01 -2 - Question number & Grade 02 - 3 03 - 7 04 - 12 05 - 9 06 - 0 9601664 - User ID 01 -2 02 - 3 03 - 7 04 - 12 05 - 9 06 - 0 I need to change the file so it looks like this 9601664 54 -... (1 Reply)
Discussion started by: Captain Woods
1 Replies

3. Shell Programming and Scripting

Error only when multiplying two numbers

Hi $ a=10 ; b=2 $ expr $a + $b 12 $ expr $a - $b 8 $ expr $a / $b 5 $ expr $a * $b expr: syntax error Any idean why I am getting this error only when multiplying two numbers. Whats the exact syntax? Thanks a lot to all in advance CSaha (5 Replies)
Discussion started by: csaha
5 Replies

4. Shell Programming and Scripting

Multiplying Floats/Decimals

Is there a way that i can get something like this to work: Number=`expr 80 \* 10.69` i.e. To multiply an integer by a decimal or a decimal by a decimal etc...? thanks (10 Replies)
Discussion started by: rleebife
10 Replies

5. Shell Programming and Scripting

matching group of words

Hi, I am stuck with a problem, will be thankful for your guidance and help. I have two files. Each line is a group of words with first word as group Id. eg. 'gp1' in File1 and 'grp1' in File2. <File1> gp1 : xyz xys3 syt2 ssx itt kty gp2 : syt2 kgk iti op2 gp3 : ppy yt5 itt sky... (11 Replies)
Discussion started by: mira
11 Replies

6. Shell Programming and Scripting

Column matching and group setting in tab demited file

Please help me with commands for the following file operations File description 5 columns in total , sorted by column 1 value First formatting, 1) Records with duplicate column 1 values are to be ignored. Just consider the first occurrence of such a record. 2) Records with (column 2 -... (3 Replies)
Discussion started by: newbie83
3 Replies

7. Programming

problem in multiplying arrays

Hi, this is my code.It's simple : there are 2 2D arrays and the multiplied to C. #include<stdio.h> #include<sys/shm.h> #include<sys/stat.h> #include<stdlib.h> main() { int *A; //A int *B; //B int *C; //C int i,j,x,k,d; int id; ... (17 Replies)
Discussion started by: giampoul
17 Replies

8. Programming

Multiplying 2D arrays using fork()

HI, i am trying to multiply 2 2D arrays (a,b) using fork. The answer will be at c. Each child have to calculate 1 row of c. The code is right, as i think of it, with no errors but i dont get the correct c array... I think there is maybe a mistake in i dimension ... Anyway, here is the code: ... (16 Replies)
Discussion started by: giampoul
16 Replies

9. UNIX for Dummies Questions & Answers

Script that sums the contents of a folder (help me)

I'm looking for a script that sums the contents of a folder, When you give a parameter to the script , i want to know the size of the directory, the number of files, number of folders, These are commands that I have already found du -s find . -type f | wc -l find . -type d | wc -ly ... (19 Replies)
Discussion started by: Roggy
19 Replies

10. Shell Programming and Scripting

Group Multiple Lines on SINGLE line matching pattern

Hi Guys, I am trying to format my csv file. When I spool the file using sqlplus the single row output is wrapped on three lines. Somehow I managed to format that file and finally i am trying to make the multiple line on single line. The below command is working fine but I need to pass the... (3 Replies)
Discussion started by: RJSKR28
3 Replies
pbmreduce(1)						      General Commands Manual						      pbmreduce(1)

NAME
pbmreduce - read a portable bitmap and reduce it N times SYNOPSIS
pbmreduce [-floyd|-fs|-threshold ] [-value val] N [pbmfile] DESCRIPTION
Reads a portable bitmap as input. Reduces it by a factor of N, and produces a portable bitmap as output. pbmreduce duplicates a lot of the functionality of pgmtopbm; you could do something like pnmscale | pgmtopbm, but pbmreduce is a lot faster. pbmreduce can be used to "re-halftone" an image. Let's say you have a scanner that only produces black&white, not grayscale, and it does a terrible job of halftoning (most b&w scanners fit this description). One way to fix the halftoning is to scan at the highest possible res- olution, say 300 dpi, and then reduce by a factor of three or so using pbmreduce. You can even correct the brightness of an image, by using the -value flag. OPTIONS
By default, the halftoning after the reduction is done via boustrophedonic Floyd-Steinberg error diffusion; however, the -threshold flag can be used to specify simple thresholding. This gives better results when reducing line drawings. The -value flag alters the thresholding value for all quantizations. It should be a real number between 0 and 1. Above 0.5 means darker images; below 0.5 means lighter. All flags can be abbreviated to their shortest unique prefix. SEE ALSO
pnmenlarge(1), pnmscale(1), pgmtopbm(1), pbm(5) AUTHOR
Copyright (C) 1988 by Jef Poskanzer. 02 August 1989 pbmreduce(1)
All times are GMT -4. The time now is 02:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy