Divide number of lines by the size of the same file. And create relational table.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Divide number of lines by the size of the same file. And create relational table.
# 8  
Old 09-29-2013
Quote:
Originally Posted by PainMaker101
Did it with echo, I thought with that you could only divide integers.
THANK YOU SO MUCH
The standards only require $((expression)) to handle integer arithmetic; recent versions of ksh support floating point operations in expression when one of the operands in an expression is a floating point value as an upwards compatible extension to the standards.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create a pivot table from CSV file

Gents, Can you please help me to create a pivot table from a csv file. ( I have zip the csv file) Using the file attached, columns 1,28 and 21 i would like to get something like this output JD Val 1 2 3 4 5 6 7 8 9 10 11 12 Total... (4 Replies)
Discussion started by: jiam912
4 Replies

2. Shell Programming and Scripting

Create a control file from Table definition

Hi Team, I need to create a control file with a pre-defined structure for a given table name. The table is in teradata. Ex: Table Name: TBL1 Table structure: create multiset table tbl1, no fallback, no before journal, no after journal, checksum = default, default mergeblockratio... (7 Replies)
Discussion started by: unankix
7 Replies

3. Shell Programming and Scripting

Is it possible to Divide a negative number in bash script

I am using a small script to divide some numbers in a given file and display the output in another file. I am getting the following error basename: invalid option -- '5' Try `basename --help' for more information. (standard_in) 1: syntax error The script is : #!/bin/bash for i in `cat... (4 Replies)
Discussion started by: kmnr877
4 Replies

4. Shell Programming and Scripting

How to get the file size and count of a table using shell scripting?

Hi there, im a beginner to the shell scripting.i trying to extract a table from a db(IMD) and i have to get the count of that table and size of the file. can you help me out how to write the shall scriping for the above query. (2 Replies)
Discussion started by: pawanmamidi
2 Replies

5. Shell Programming and Scripting

AWK print number of records, divide this number

I would like to print the number of records of 2 files, and divide the two numbers awk '{print NR}' file1 > output1 awk '{print NR}' file2 > output2 paste output1 output2 > output awl '{print $1/$2}' output > output_2 is there a faster way? (8 Replies)
Discussion started by: programmerc
8 Replies

6. UNIX for Dummies Questions & Answers

create table file from different files with index

Hi, I've several files with two collumns, where first collumn can be used as index. filename1 and filename2 how to create a file I should start with cat all files and extract first collumn to create an index? (4 Replies)
Discussion started by: sargotrons
4 Replies

7. Shell Programming and Scripting

Add and divide each numbers with the added number

Hi All, I am stuck with this problem. I have some 100000 (.dat) 1.dat, 2.dat,3.dat etc until 100000.dat files which look like this: 1.dat 1 2 3 4 0.99 4.54 All my files 1.dat until 100000.dat look the same but with different numbers. I have to first add all the numbers in each... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

8. UNIX and Linux Applications

create table via stored procedure (passing the table name to it)

hi there, I am trying to create a stored procedure that i can pass the table name to and it will create a table with that name. but for some reason it creates with what i have defined as the variable name . In the case of the example below it creates a table called 'tname' for example ... (6 Replies)
Discussion started by: rethink
6 Replies

9. Shell Programming and Scripting

to create an output file as a table

Hi, I have four input files and would like to create an output file as a table. Please check the example below. File 1. 111111 222222 333333 444444 File 2. 555555 666666 777777 888888 File 3. aaaaa bbbbb ccccc ddddd (2 Replies)
Discussion started by: marcelus
2 Replies

10. Shell Programming and Scripting

Create n number of files of size x

What is the best way to create 'n' number of files of size 'x' lets say n and x are given as arguments to the program.. and lets say we can simply fill the files with 0s or *'s Thanks !! (2 Replies)
Discussion started by: the_learner
2 Replies
Login or Register to Ask a Question
ARITHMETIC(6)							 BSD Games Manual						     ARITHMETIC(6)

NAME
arithmetic -- quiz on simple arithmetic SYNOPSIS
arithmetic [-o +-x/] [-r range] DESCRIPTION
arithmetic asks you to solve problems in simple arithmetic. Each question must be answered correctly before going on to the next. After every 20 problems, it prints the score so far and the time taken. You can quit at any time by typing the interrupt or end-of-file character. The options are as follows: -o By default, arithmetic asks questions on addition of numbers from 0 to 10, and corresponding subtraction. By supplying one or more of the characters +-x/, you can ask for problems in addition, subtraction, multiplication, and division, respectively. If you give one of these characters more than once, that kind of problem will be asked correspondingly more often. -r If a range is supplied, arithmetic selects the numbers in its problems in the following way. For addition and multiplication, the numbers to be added or multiplied are between 0 and range, inclusive. For subtraction and division, both the required result and the number to divide by or subtract will be between 0 and range. (Of course, arithmetic will not ask you to divide by 0.) The default range is 10. When you get a problem wrong, arithmetic will remember the numbers involved, and will tend to select those numbers more often than others, in problems of the same sort. Eventually it will forgive and forget. arithmetic cannot be persuaded to tell you the right answer. You must work it out for yourself. DIAGNOSTICS
``What?'' if you get a question wrong. ``Right!'' if you get it right. ``Please type a number.'' if arithmetic doesn't understand what you typed. SEE ALSO
bc(1), dc(1) BSD
May 31, 1993 BSD