Sponsored Content
Top Forums Shell Programming and Scripting exchange values in a table - exchange numbers Post 302714703 by @man on Friday 12th of October 2012 12:54:57 PM
Old 10-12-2012
exchange values in a table - exchange numbers

Hello all,

This is a bit simple but I cannot do it! I have a big table of values between 0 and 1. some cells have NA instead of having any value.

I want to exchange all values with "1" and write "0" for all "NA" .

for changing "NA" to zero I used sed:
Code:
sed -i 's/NA/0/g' input.txt

But I have no clue for changing all numbers to 1.

I appreciate if you can help me with this.

---------- Post updated at 06:54 PM ---------- Previous update was at 06:47 PM ----------

I have managed to do it with this:

Code:
sed -e 's/[0-9]*\.[0-9]*/1/g' -e 's/NA/0/g' in.txt > out.txt

I hope it's correct! Smilie
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mail exchange

Hi everyone I am setting up my own web hosting and dns server - have got all the dns and web server things sorted out. I am wondering if anyone knows what I need to do to enable my customers to have their own pop and smtp access under their own domains which they host with me. I have two ip... (2 Replies)
Discussion started by: alwayslearningunix
2 Replies

2. Windows & DOS: Issues & Discussions

Connecting to an Exchange Server

Hi, I have installed Redhat 7.3 on my desktop at work and was wondering whether I can set up my mail in KDE(Kmail, Mozilla Mail etc) to connect to a microsoft exchange server. Thanks for any help! (2 Replies)
Discussion started by: camerja1
2 Replies

3. UNIX for Dummies Questions & Answers

mailing from unix -> exchange

Hello, I want to mail from Unix 4.3 (on an RS/6000) to my Microsoft exchange server (5.5). When I trie : mail -v erikr@domain.nl < /directory/file I get the following error: ^Cserverone:/etc >WARNING: The local host name (serverone) does not have a domain; fix$jnconfig ... (7 Replies)
Discussion started by: Erik Rooijmans
7 Replies

4. UNIX for Dummies Questions & Answers

Mail Exchange Server

I've got a question regarding setting up mail between two unix boxes. Is it possible to setup two boxes conected via a hub and allow them to send mail using the Netscape Messenger. I know that I can be done so using the UNIX sendmail but I need to connect them via Messenger as my ultimate goal is... (0 Replies)
Discussion started by: GlockCW
0 Replies

5. Windows & DOS: Issues & Discussions

exporting exchange information

Hey all, I have teh job of exporting all the information for around 500 e-mail addresses from exchange into something like a excel sheet. I was pretty quiet one afternoon last week (and bore) so I added them to my adddresses book then exported them to excel. But I now have a problem, it does... (0 Replies)
Discussion started by: woofie
0 Replies

6. AIX

Relay to Exchange Server

AIX 5.3 Domain: domainna Exchange Server: ex05.domainname.com Our emails that are generated from Unix going to the "outside world" are now being rejected by most hosts. The current relay is listed as user@domainna. Here is a snippet from the log... 1356561:Aug 21 08:04:05 domainna... (0 Replies)
Discussion started by: andrewsc
0 Replies

7. AIX

Exchange one server to another

Hi people, In my work i have 2 P595 server (P595A and P595B) i need to exchange one server from P595A to P595B and one from P595B to P595A, i know the best way to do this is make a mksysb copy of the system and restore it on another but, in this process i dont need to exchange all the server,... (4 Replies)
Discussion started by: anonymouzz
4 Replies
shishi_kdc_process(3)						      shishi						     shishi_kdc_process(3)

NAME
shishi_kdc_process - API function SYNOPSIS
#include <shishi.h> int shishi_kdc_process(Shishi * handle, Shishi_asn1 kdcreq, Shishi_asn1 kdcrep, Shishi_key * key, int keyusage, Shishi_asn1 * enckdcrep- part); ARGUMENTS
Shishi * handle shishi handle as allocated by shishi_init(). Shishi_asn1 kdcreq input variable that holds the sent KDC-REQ. Shishi_asn1 kdcrep input variable that holds the received KDC-REP. Shishi_key * key input array with key to decrypt encrypted part of KDC-REP with. int keyusage kereros key usage value. Shishi_asn1 * enckdcreppart output variable that holds new EncKDCRepPart. DESCRIPTION
Process a KDC client exchange and output decrypted EncKDCRepPart which holds details for the new ticket received. Use shishi_kdcrep_get_ticket() to extract the ticket. This function verifies the various conditions that must hold if the response is to be considered valid, specifically it compares nonces (shishi_kdc_check_nonce()) and if the exchange was a AS exchange, it also compares cname and crealm (shishi_as_check_cname() and shishi_as_check_crealm()). Usually the shishi_as_process() and shishi_tgs_process() functions should be used instead, since they simplify the decryption key computa- tion. RETURN VALUE
Returns SHISHI_OK iff the KDC client exchange was successful. REPORTING BUGS
Report bugs to <bug-shishi@gnu.org>. COPYRIGHT
Copyright (C) 2002-2010 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command info shishi should give you access to the complete manual. shishi 1.0.1 shishi_kdc_process(3)
All times are GMT -4. The time now is 06:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy