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
IPSEC_IKEPING(8)						  [FIXME: manual]						  IPSEC_IKEPING(8)

NAME
ipsec_ikeping - send/receive ISAKMP/IKE echo requests/replies SYNOPSIS
ipsec ikeping [--listen] [--verbose] [--wait time] [--exchangenum num] [--ikeport localport] [--ikeaddress address] [--inet] [--inet6] destaddr [/dstport...] DESCRIPTION
Ikeping sends and receives ISAKMP/IKE echo request and echo reply packets. These packets are intended for diagnostics purposes, in a manner similar to ping(8) does for ICMP echo request/reply packets. At the time of this writing, the ISAKMP echo request/reply exchange is still an internet-draft (draft-richardson-ipsec-ikeping-00), and is therefore completely non-standard. The Openswan IKE daemon pluto does implement this draft, so ikeping can be used to test connectivity to an openswan ipsec server. Ikeping will bind to the local address given by --ikeaddress and the port number given by --ikeport defaulting to the wildcard address and the ISAKMP port 500. An ISAKMP exchange of type 244 (a private use number) is sent to each of the address/ports listed on the command line. The exchange number may be overridden by the --exchangenum option. Ikeping then listens for replies, printing them as they are received. Replies are of exchange type 245 or the specified exchange number plus 1. Ikeping will keep listening until it either receives as many echo responses as it sent, or until the timeout period (5 seconds) has been reached. Receipt of a packet will reset the timer. The --wait option can be used to specify a different timeout period. If the --listen option is given, then ikeping will not send any packets. Instead, it will listen for them and reply to each request received. If the --natt option is given, then ikeping will set the socket to permit UDP encapsulated ESP packets. This is only useful in listen mode. FILES
no external files SEE ALSO
ping(8), ipsec_pluto(8) HISTORY
Written for the Linux FreeS/WAN project <http://www.freeswan.org> by Michael Richardson. [FIXME: source] 10/06/2010 IPSEC_IKEPING(8)
All times are GMT -4. The time now is 10:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy