Sponsored Content
Top Forums Shell Programming and Scripting Help with keep the smallest record in file Post 303023892 by RudiC on Tuesday 25th of September 2018 08:45:09 AM
Old 09-25-2018
On top of what Don Cragun already asked, where has the PZ Ballon 50 record gone?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

splitting a record and adding a record to a file

Hi, I am new to UNIX scripting and woiuld appreicate your help... Input file contains only one (but long) record: aaaaabbbbbcccccddddd..... Desired file: NEW RECORD #new record (hardcoded) added as first record - its length is irrelevant# aaaaa bbbbb ccccc ddddd ... ... ... (1 Reply)
Discussion started by: rsolap
1 Replies

2. UNIX for Advanced & Expert Users

Script to search a bad record in a file then put the record in the bad file

I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file. Example: File1 Name designation dateOfJoining... (1 Reply)
Discussion started by: shilendrajadon
1 Replies

3. Shell Programming and Scripting

Script to search a bad record in a file then put the record in the bad file

I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file. Example: File1 Name designation dateOfJoining... (2 Replies)
Discussion started by: shilendrajadon
2 Replies

4. UNIX for Dummies Questions & Answers

how to read record by record from a file in unix

Hi guys, i have a big file with the following format.This includes header(H),detail(D) and trailer(T) information in the file.My problem is i have to search for the character "6h" at 14 th and 15 th position in all the records .if it is there i have to write all those records into a... (1 Reply)
Discussion started by: raoscb
1 Replies

5. Shell Programming and Scripting

the smallest number from 90% of highest numbers from all numbers in file

Hello All, I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns. I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions. If I... (11 Replies)
Discussion started by: Apfik
11 Replies

6. Programming

Help with find highest and smallest number in a file with c

Input file: #data_1 AGDG #data_2 ADG #data_3 ASDDG DG #data_4 A Desired result: Highest 7 Slowest 1 code that I try but failed to archive my goal :( #include <stdio.h> (2 Replies)
Discussion started by: cpp_beginner
2 Replies

7. Shell Programming and Scripting

Problem to print out record got smallest number in specific column

Hi, Anybody know how to print out the record that shown smallest number among column 3 and column 4 Case 1 Input : 37170 37196 77 51 37174 37195 73 52 37174 37194 73 53 Case 1 Output : 37170 37196 77 51 Case 2 Input : 469613 469660 73 ... (4 Replies)
Discussion started by: cpp_beginner
4 Replies

8. Shell Programming and Scripting

Problem facing to compare different column and print out record with smallest number

Hi, Input file 1 : 37170 37196 77 51 37174 37195 73 52 37174 37194 73 53 Desired Output file 1 : 37170 37196 77 51 Input file 2 : 37174 37195 73 0 37170 37196 77 0 Desired Output file 2 : 37174 37195 73 0 (1 Reply)
Discussion started by: cpp_beginner
1 Replies

9. Shell Programming and Scripting

Extract timestamp from first record in xml file and it checks if not it will replace first record

I have test.xml <emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp> <Join><id>101</id><city>london</city><date>06/06/14 2011</date></join> <Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join> <Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies

10. Shell Programming and Scripting

Print smallest integer from file using awk custom function?

`awk` function looks like this in a file name `fun.awk`: { print small() } function small() { a=$0 smal=0 for(i=1;i<=3;i++) { if( a<a) smal=a else (4 Replies)
Discussion started by: lazerz
4 Replies
DC(1)							      General Commands Manual							     DC(1)

NAME
dc - desk calculator SYNOPSIS
dc [ file ] DESCRIPTION
Dc is an arbitrary precision arithmetic package. Ordinarily it operates on decimal integers, but one may specify an input base, output base, and a number of fractional digits to be maintained. The overall structure of dc is a stacking (reverse Polish) calculator. If an argument is given, input is taken from that file until its end, then from the standard input. The following constructions are recognized: number The value of the number is pushed on the stack. A number is an unbroken string of the digits 0-9. It may be preceded by an under- score _ to input a negative number. Numbers may contain decimal points. + - / * % ^ The top two values on the stack are added (+), subtracted (-), multiplied (*), divided (/), remaindered (%), or exponentiated (^). The two entries are popped off the stack; the result is pushed on the stack in their place. Any fractional part of an exponent is ignored. sx The top of the stack is popped and stored into a register named x, where x may be any character. If the s is capitalized, x is treated as a stack and the value is pushed on it. lx The value in register x is pushed on the stack. The register x is not altered. All registers start with zero value. If the l is capitalized, register x is treated as a stack and its top value is popped onto the main stack. d The top value on the stack is duplicated. p The top value on the stack is printed. The top value remains unchanged. P interprets the top of the stack as an ascii string, removes it, and prints it. f All values on the stack and in registers are printed. q exits the program. If executing a string, the recursion level is popped by two. If q is capitalized, the top value on the stack is popped and the string execution level is popped by that value. x treats the top element of the stack as a character string and executes it as a string of dc commands. X replaces the number on the top of the stack with its scale factor. [ ... ] puts the bracketed ascii string onto the top of the stack. <x >x =x The top two elements of the stack are popped and compared. Register x is executed if they obey the stated relation. v replaces the top element on the stack by its square root. Any existing fractional part of the argument is taken into account, but otherwise the scale factor is ignored. ! interprets the rest of the line as a UNIX command. c All values on the stack are popped. i The top value on the stack is popped and used as the number radix for further input. I pushes the input base on the top of the stack. o The top value on the stack is popped and used as the number radix for further output. O pushes the output base on the top of the stack. k the top of the stack is popped, and that value is used as a non-negative scale factor: the appropriate number of places are printed on output, and maintained during multiplication, division, and exponentiation. The interaction of scale factor, input base, and out- put base will be reasonable if all are changed together. z The stack level is pushed onto the stack. Z replaces the number on the top of the stack with its length. ? A line of input is taken from the input source (usually the terminal) and executed. ; : are used by bc for array operations. An example which prints the first ten values of n! is [la1+dsa*pla10>y]sy 0sa1 lyx SEE ALSO
bc(1), which is a preprocessor for dc providing infix notation and a C-like syntax which implements functions and reasonable control struc- tures for programs. DIAGNOSTICS
`x is unimplemented' where x is an octal number. `stack empty' for not enough elements on the stack to do what was asked. `Out of space' when the free list is exhausted (too many digits). `Out of headers' for too many numbers being kept around. `Out of pushdown' for too many items on the stack. `Nesting Depth' for too many levels of nested execution. DC(1)
All times are GMT -4. The time now is 01:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy