Dear All,
I have the following file tabulated:
What I would like to do is the following, create 100 new files based on content of the second column,
The first file should contain all the lines with a distance between 0 and 1000,
the second between 1000 and 2000, and so on untile 99000 and 10000,
Finally for each new file I would like to calculate the median of the third column(score)
Is there a rapid way to do so? I tried witha perl script but it seems really slow,
thanks for your help,
Paolo
Last edited by paolo.kunder; 11-19-2013 at 09:03 AM..
Hello, I am using awk to split a file into multiple files using command:
nawk '{
if ( $1 == "<process" )
{
n=split($2, arr, "\"");
file=arr
}
print > file }' processes.xml
<process name="Process1.process">
... (3 Replies)
Arun kumar something somehting Enterting in to the line
.
.
.
.
Some text text Finshing the sentence
Some other text
.
.
.
.
Again something somehting Enterting in to the line
.
.
.
.
.
.
Again text text Finshing the sentence (6 Replies)
Hi,
I've one requirement. I have to split one comma delimited file into multiple files based on one of the column values.
How can I achieve this Unix
Here is the sample data. In this case I have split the files based on date column(c4)
Input file
c1,c2,c3,c4,c5... (1 Reply)
Good day all
I need some helps,
say that I have data like below, each field separated by a tab
DATE NAME ADDRESS
15/7/2012 LX a.b.c
15/7/2012 LX1 a.b.c
16/7/2012 AB a.b.c
16/7/2012 AB2 a.b.c
15/7/2012 LX2 a.b.c... (2 Replies)
Hi,
I have a Huge 7 GB file which has around 1 million records, i want to split this file into 4 files to contain around 250k messages each.
Please help me as Split command cannot work here as it might miss tags..
Format of the file is as below
<!--###### ###### START-->... (6 Replies)
Hi All,
I have the sales_data.csv file in the directory as below.
SDDCCR; SOM ; MD6546474777 ;05-JAN-16
ABC ; KIRAN ; CB789 ;04-JAN-16
ABC ; RAMANA; KS566767477747 ;06-JAN-16
ABC ; KAMESH; A33535335 ;04-JAN-16
SDDCCR; DINESH; GD6674474747 ;08-JAN-16... (4 Replies)
Hi,
I have two pipe separated files as below:
head -3 file1.txt
"HD"|"Nov 11 2016 4:08AM"|"0000000018"
"DT"|"240350264"|"56432"
"DT"|"240350264"|"56432"
head -3 file2.txt
"HD"|"Nov 15 2016 2:18AM"|"0000000019"
"DT"|"240350264"|"56432"
"DT"|"240350264"|"56432"
I want to list the... (6 Replies)
I need to split the file contents with multiple rows based on patterns
Sample:
Input:
ABC101testXYZ102UKMNO1092testing
ABC999testKMNValid
Output:
ABC101test
XYZ102U
KMN1092testing
ABC999test
KMNValid
In this ABC , XYZ and KMN are patterns
Continue here./mod]
Please read forum... (1 Reply)
I need to split the file contents with multiple rows based on patterns
Sample:
Input:
ABC101testXYZ102UKMNO1092testing
ABC999testKMNValid
Output:
ABC101test
XYZ102U
KMN1092testing
ABC999test
KMNValid
In this ABC , XYZ and KMN are patterns (6 Replies)
Discussion started by: Jairaj
6 Replies
LEARN ABOUT NETBSD
tetris
TETRIS(6) BSD Games Manual TETRIS(6)NAME
tetris -- the game of tetris
SYNOPSIS
tetris [-ps] [-k keys] [-l level]
DESCRIPTION
The tetris command runs display-based game which must be played on a CRT terminal. The object is to fit the shapes together forming complete
rows, which then vanish. When the shapes fill up to the top, the game ends. You can optionally select a level of play, or custom-select
control keys.
The default level of play is 2.
The default control keys are as follows:
j move left
k rotate 1/4 turn counterclockwise
l move right
<space> drop
p pause
q quit
The options are as follows:
-k The default control keys can be changed using the -k option. The keys argument must have the six keys in order, and, remember to
quote any space or tab characters from the shell. For example:
tetris -l 2 -k 'jkl pq'
will play the default games, i.e. level 2 and with the default control keys. The current key settings are displayed at the bottom of
the screen during play.
-l Select a level of play.
-s Display the top scores.
-p Switch on previewing of the shape that will appear next.
PLAY
At the start of the game, a shape will appear at the top of the screen, falling one square at a time. The speed at which it falls is deter-
mined directly by the level: if you select level 2, the blocks will fall twice per second; at level 9, they fall 9 times per second. (As the
game goes on, things speed up, no matter what your initial selection.) When this shape ``touches down'' on the bottom of the field, another
will appear at the top.
You can move shapes to the left or right, rotate them counterclockwise, or drop them to the bottom by pressing the appropriate keys. As you
fit them together, completed horizontal rows vanish, and any blocks above fall down to fill in. When the blocks stack up to the top of the
screen, the game is over.
SCORING
You get one point for every block you fit into the stack, and one point for every space a block falls when you hit the drop key. (Dropping
the blocks is therefore a good way to increase your score.) Your total score is the product of the level of play and your accumulated points
-- 200 points on level 3 gives you a score of 600. Each player gets at most one entry on any level, for a total of nine scores in the high
scores file. Players who no longer have accounts are limited to one score. Also, scores over 5 years old are expired. The exception to
these conditions is that the highest score on a given level is always kept, so that following generations can pay homage to those who have
wasted serious amounts of time.
The score list is produced at the end of the game. The printout includes each player's overall ranking, name, score, and how many points
were scored on what level. Scores which are the highest on a given level are marked with asterisks ``*''.
FILES
/var/games/tetris.scores high score file
AUTHORS
Adapted from a 1989 International Obfuscated C Code Contest winner by Chris Torek and Darren F. Provine.
Manual adapted from the original entry written by Nancy L. Tinkham and Darren F. Provine.
Code for previewing next shape added by Hubert Feyrer in 1999.
BUGS
The higher levels are unplayable without a fast terminal connection.
BSD May 31, 1993 BSD