I'm sure you guys have answered this elsewhere but I can't seem to find where so here goes.
#!/bin/bash
n=120
a=$(sed '120q;d' energy.xvg)
while ;do
a=$(sed $n'q;d' energy.xvg)
echo "$a \n" > newfile
n=$(($n+100))
done
exit 0
that script should read the file energy.xvg, start at... (1 Reply)
I need a perl script to find and replace a specific pattern in a file to a new line.
BAsically I have a single line data in a file with 10 mb to 200 MB. I want to put a new line based on a specific pattern to open the file in Excel / Access.
Following is the sample data in a file
... (1 Reply)
I have posted it previously but somehow could not delete the previous post.I felt i could not explain the problem statement well.
Here t goes.I have a file say File1. Now i need a specific pattern from the lines to be added to the other line.
File:
red blue green ABC.txt@ABC END
black... (1 Reply)
Hi,
I have this line:
ip=111.222.133.144,mac=00:16:3E:2A:08:3C,vifname=veth360','ip=10.2.3.4,vifname=veth360a'
^
|
-------
I want to insert this IP 144.133.222.111 between "144"... (4 Replies)
Friends ,
I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated.
My File
control station *ATM* , qread $OSS.Jul13A.FI01 interval 1 intcount 1
control station *ATM* , qread $OSS.Jul13A.FI02 interval 1 intcount... (4 Replies)
Could anyone tell me how to insert a line at a particular line number using sed.
sed '2i\newtext' filename
I have tried the above command .But it is not working. I am using tcsh shell .Please help.
Double post, continued here (0 Replies)
hello ..
I am new to perl scripting, I have a text file, and would like to insert 3 new lines into the same file at different line numbers using perl scripting. Any Help regarding this will be very useful.
say the file is sample.txt, contents are
aaaaa
bbbb
ccccc
dddd
eeeee
ffffffff... (4 Replies)
I need to insert text from one file into another file after specific term. I guess sed is the best method of doing this and I can insert a specified text string using this script but I am not sure how to modify it to insert text from another file:
#!/bin/sh
sed 's/\<VirtualHost... (17 Replies)
Hello,
I've been trying to get a script working that fetches weather-data and converts it into an .ics file. The script works so far put I'm stuck at the point where I need to add specific static data. A thorough search through the forum did not point me into the right direction.
#!/bin/bash... (3 Replies)
Hi,
consider a file called mobile.txt as follows:
For type lovers, add a new line at the end of it by copying its previous line and add a +1 to the field1, field2
Additionally, there are only 3 plans available to lovers type, so it should not work for lovers type already having 3 lines under... (11 Replies)
Discussion started by: Gautham
11 Replies
LEARN ABOUT DEBIAN
nash
NASH(1) lrslib 0.42b NASH(1)NAME
nash - find nash equilibria of two person noncooperative games
SYNOPSIS
setupnash input game1.ine game2.ine
setupnash2 input game1.ine game2.ine
nash game1.ine game2.ine
2nash game1.ine game2.ine
DESCRIPTION
All Nash equilibria (NE) for a two person noncooperative game are computed using two interleaved reverse search vertex enumeration steps.
The input for the problem are two m by n matrices A,B of integers or rationals. The first player is the row player, the second is the
column player. If row i and column j are played, player 1 receives Ai,j and player 2 receives Bi,j. If you have two or more cpus available
run 2nash instead of nash as the order of the input games is immaterial. It runs in parallel with the games in each order. (If you use
nash, the program usually runs faster if m is <= n , see below.) The easiest way to use the program nash or 2nash is to first run setupnash
or ( setupnash2 see below ) on a file containing:
m n
matrix A
matrix B
eg. the file game is for a game with m=3 n=2:
3 2
0 6
2 5
3 3
1 0
0 2
4 3
% setupnash game game1 game2
produces two H-representations, game1 and game2, one for each player. To get the equilibria, run
% nash game1 game2
or
% 2nash game1 game2
Each row beginning 1 is a strategy for the row player yielding a NE with each row beginning 2 listed immediately above it.The payoff for
player 2 is the last number on the line beginning 1, and vice versa. Eg: first two lines of output: player 1 uses row probabilities 2/3 2/3
0 resulting in a payoff of 2/3 to player 2.Player 2 uses column probabilities 1/3 2/3 yielding a payoff of 4 to player 1. If both matrices
are nonnegative and have no zero columns, you may instead use setupnash2:
% setupnash2 game game1 game2
Now the polyhedra produced are polytopes. The output of nash in this case is a list of unscaled probability vectors x and y. To normalize,
divide each vector by v = 1^T x and u=1^T y.u and v are the payoffs to players 1 and 2 respectively. In this case, lower bounds on the
payoff functions to either or both players may be included. To give a lower bound of r on the payoff for player 1 add the options to file
game2 (yes that is correct!)To give a lower bound of r on the payoff for player 2 add the options to file game1
minimize
0 1 1 ... 1 (n entries to begiven)
bound 1/r; ( note: reciprocal of r)
If you do not wish to use the 2-cpu program 2nash, please read the following. If m is greater than n then nash usually runs faster by
transposing the players. This is achieved by running:
% nash game2 game1
If you wish to construct the game1 and game2 files by hand, see the lrslib user manual[1]
SEE ALSO
For information on H-representation file formats, see the man page for lrslib or the lrslib user manual[2]
NOTES
1. lrslib user manual
http://cgm.cs.mcgill.ca/%7Eavis/C/lrslib/USERGUIDE.html#Nash%20Equilibria
2. lrslib user manual
http://cgm.cs.mcgill.ca/%7Eavis/C/lrslib/USERGUIDE.html#File%20Formats
July 2009 03/30/2011 NASH(1)