06-04-2008
OK I cant show a complete file (They are big!)
So this is a section of one of the text files
-99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 001037 001015 000946 001044 001059 001049 001074 001064 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 001053 001031 000812 000993 000663 001089 001071 000994 001066 001099 001104 001073 000959 000982 001062 001039 001020 001041 001071 001020 001041 000972 000941 000944 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
Basically I want to ignore the -99999's and convert all other numbers EQUAL OR GREATER THAN 0 (I apologise I didn't put the EQUAL in before!) to 1.
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Could someone tell me how to perform calculations using numbers greater than 2150000000 in Korn Shell? When I tried to do it it gave me the wrong answer.
e.g. I have a ksh file with the contents below:
---------------------------------
#!/bin/ksh
SUM=`expr 2150000000 + 2`
PRODUCT=`expr... (3 Replies)
Discussion started by: stevefox
3 Replies
2. Shell Programming and Scripting
Hi All,
I am trying to write a shell script which firstly will search some files and then increase the port numbers mentioned in them by a certain no.
let me clear it with an example-
suppose there r few files a,b,c,d....
file a's content-
<serverEntries xmi:id="ServerEntry_1"... (3 Replies)
Discussion started by: ankushsingh10
3 Replies
3. Shell Programming and Scripting
Hi,
I have lines in some files that look exactly as below, and the line numbers they occur in are always the same. (Lines 136-139)
W 0.00000000 0.00000000 2.00000000
W 0.50000000 0.50000000 2.50000000
W 0.00000000 0.00000000 3.00000000
W 0.50000000 0.50000000 3.50000000
I'd like to... (0 Replies)
Discussion started by: bluesmodular
0 Replies
4. Shell Programming and Scripting
Greetings,
I am using tcsh to write a script that will replace the numbers in a file with a single number, the caveat is that this file has blank lines which are necessary for another step down the line so I need to preserve the blank lines. I have tried sed and awk but both will collapse the... (1 Reply)
Discussion started by: bonesy
1 Replies
5. UNIX for Dummies Questions & Answers
i have a file contains:
13213,A,300
3423,C,200
5563,A,201
3000,A,400
3000,A,402
3000,A,206
3000,A,303
3000,A,200
4233,N,204
i need to search for numbers in the first column are greater than 3000?
i have another issue if you can help me?
if i want to search in the second or the... (7 Replies)
Discussion started by: takyeldin
7 Replies
6. Shell Programming and Scripting
hi i have two files
one of the form
1 2
2 45
3 56
4 98
5 6598
6 98
7 10
8 0
9 15
10 56
This file's significance is that it maps the number in first column to that of the number in second column
The other file is of the form
1
2 (1 Reply)
Discussion started by: vaibhavkorde
1 Replies
7. Shell Programming and Scripting
I have a file with multiple fields, example below
File 1:
Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|100
Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|101
Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|102
Field 1|Field 2|Field 3|Field 4|Field 5|Field... (4 Replies)
Discussion started by: castrojc
4 Replies
8. UNIX for Dummies Questions & Answers
I'm trying to grep lines where the digits at the end of each line are greater than digits. Tried this but it will only allow me to specify 2 digits. Any ideas would greatly be appreciated. grep -i '\<\{3,4,5\}\>' file
---------- Post updated at 05:58 PM ---------- Previous update was at 05:41... (1 Reply)
Discussion started by: jimmyf
1 Replies
9. Shell Programming and Scripting
Hi, I need to replace a character between two numbers (specifically a - to a _). The problem is that they can be *any* numbers. So, I need a one liner to turn a file like this:
1-2
3-4
55-66
4323-12312893
into the following
1_2
3_4
55_66
4323_12312893
Any help would be appreciated! (5 Replies)
Discussion started by: mikey11415
5 Replies
10. UNIX for Advanced & Expert Users
This helped get me started.
https://www.unix.com/unix-for-dummies-questions-and-answers/157026-need-command-search-numbers-greater-than-3000-a.html
This is the command I am using. I am trying to find numbers greater than 70 in column 5. I do not know if it is getting confused because there... (6 Replies)
Discussion started by: cokedude
6 Replies
mktemp(3C) mktemp(3C)
NAME
mktemp(), mkstemp() - make a unique file name
SYNOPSIS
Remarks
These functions are provided solely for backward compatibility and importability of applications, and are not recommended for new applica-
tions where portability is important. For portable applications, use instead (see tmpfile(3S)).
DESCRIPTION
replaces the contents of the string pointed to by template by a unique file name, and returns the address of template. The string in tem-
plate should look like a file name with six trailing replaces each with a single byte character from the portable filename character set.
The letter is chosen such that the resulting name does not duplicate the name of an existing file.
makes the same replacement to the template, but also returns a file descriptor for the template file after opening the file for reading and
writing. thus prevents any possible race condition between testing whether the file exists and opening it for use.
RETURN VALUE
returns its argument except when it runs out of letters or an underlying service fails, in which case the result is a pointer to an empty
string
returns an open file descriptor upon successful completion, or -1 if no suitable file could be created.
WARNINGS
It is possible to run out of letters.
and do not check to determine whether the file name part of template exceeds the maximum allowable file name length.
Setting kernel tunable to values greater than 99999 can have an effect on formation of temporary filenames in and
Formation of temporary filenames using process ids may not be supported in future versions of and
SEE ALSO
getpid(2), open(2), tmpfile(3S), tmpnam(3S), thread_safety(5).
STANDARDS CONFORMANCE
mktemp(3C)