Sponsored Content
Top Forums Shell Programming and Scripting ksh program that finds the lowest number in a .txt file Post 302567326 by ahamed101 on Monday 24th of October 2011 01:33:40 AM
Old 10-24-2011
We don't know how your text file looks like... We dont't know how you are punching in the numbers... So show us...

If the text file has the numbers line by line, try this...
Code:
sort input.txt | head -1

--ahamed
 

10 More Discussions You Might Find Interesting

1. AIX

Printing a number of copies of a txt file

Hi, We have an application running on AIX5.3 that generates text files that are sent to be printed using the lp command. The user can specify the number of copies they want printed, but only one copy ever gets printed. I've checked the lp command that is used, and it correctly specifies... (5 Replies)
Discussion started by: stebradshaw
5 Replies

2. UNIX for Dummies Questions & Answers

Get the number from the txt file

Hello Guy, I have the following information in the sample.txt, can i get the number and output into sample2.txt - - - - - - - - - - - - - ... (7 Replies)
Discussion started by: happyv
7 Replies

3. Shell Programming and Scripting

Korn Shell - Finding lowest number of a file.

I'm writing a KSH script that will get a file on the command line (such as input.txt), and in this file there is on number per line. The program needs to take the file, read each and determine the lowest number in the file. I currently have a while loop setup that will correctly out put every... (8 Replies)
Discussion started by: denyal
8 Replies

4. Shell Programming and Scripting

print every 20 lines the lowest number

Hello all, How can I find the lowest number every 10 lines? For example i have a list name1 -0.1 name2 2 name3 3 name4 -3 name5 1 name6 2 name7 34 name8 34 (6 Replies)
Discussion started by: TheTransporter
6 Replies

5. Shell Programming and Scripting

KSH script for split a txt file

I have a problem which I would like to solve by using UNIX power and inspired minds around world. Here is the problem I have a text file and it has data as follows 1X.....................1234567890123456789T1234598765XT1 (header) 1Z01............(sub HEADER) P100001............ Q1........... (4 Replies)
Discussion started by: ask.chowhan
4 Replies

6. UNIX for Dummies Questions & Answers

how to generate random number as as the first column of a txt file

Dear all, I have a question. I have a txt file say 4000 rows X 1800 Column. I 'd like to creat a new column as the first column which is a column of random numbers (n=4000) thanks a lot! Lin (2 Replies)
Discussion started by: forevertl
2 Replies

7. Shell Programming and Scripting

Perl: find next available lowest number that is available in two arrays

Hi there. I have a number allocation problem whereby I have 2 arrays built from 2 different sources. The arrays will just contain a listed of sorted numbers @a 1 7 10 14 15 16 @b 1 7 10 11 14 15 16 (2 Replies)
Discussion started by: hcclnoodles
2 Replies

8. Shell Programming and Scripting

Ksh: Send a mail in case grep finds something

I want to search a file if it contains special strings and if yes, the records found should be mailed. I can either do it with a temporary file: /usr/bin/grep somestring somefile > /tmp/tempfile && /usr/bin/mail -s "Found something" email@mycomp.com < /tmp/tempfile... or by running the grep... (10 Replies)
Discussion started by: Cochise
10 Replies

9. Shell Programming and Scripting

Sort from highest to lowest number

Hi Guys, I am looking for a way to sort the output below from the "Inuse" count from Highest to Lowest. Is it possible? Thanks in advance. user1 0.12 0.06 0 0.12 User Inuse Pin Pgsp Virtual Unit:... (4 Replies)
Discussion started by: jaapar
4 Replies

10. UNIX for Beginners Questions & Answers

Split a txt file on the basis of line number

I have to split a file containing 100 lines to 5 files say from lines ,1-20 ,21-30 ,31-40 ,51-60 ,61-100 Here is i can do it for 2 file but how to handle it for more than 2 files awk 'NR < 21{ print >> "a"; next } {print >> "b" }' $input_file Please advidse. Thanks (4 Replies)
Discussion started by: abhaydas
4 Replies
MKZONEDB(8)						    Linux System Administration 					       MKZONEDB(8)

NAME
mkzonedb - Utility create a zone file for isdnlog SYNOPSIS
mkzonedb -r zonefile -d database [-v] [-V] [-o Oz] [-l len] DESCRIPTION
mkzonedb reads a text file with zone (area code) information, and writes it in a special format to the database file so that other apps such as isdnlog can easily access the data. This data is used to determine in what "zone" a given area code is in relation to another, to see what rate applies to a call between these area codes ("is the call a local call"). This utility is really only used during the building of the isdnlog-data package, but it may be useful for those who want to create their own custom tables. OPTIONS
-r zonefile the text file with the zone information. Use "-" for standard input. -d database the output database filename -v verbose mode -V show version information, and quit (don't do anything) -o Oz Use "Oz" area zone. Default is 1. (What does this mean, exactly?) -l len "len" is the length of areacodes. If 5 or more is given, then more space is allocated for the internal tables (40000 instead of 10000 numbers allowed). Other values aren't really used. AUTHOR
manpage written from C source by Paul Slootman <paul@debian.org>. mkzonedb 2003/03/11 MKZONEDB(8)
All times are GMT -4. The time now is 05:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy