Find multiple patterns on multiple lines and concatenate output
I'm trying to parse COBOL code to combine variables into one string. I have two variable names that get literals moved into them and I'd like to use sed, awk, or similar to find these lines and combine the variables into the final component. These variable names are always VAR1 and VAR2. For example, I'd like to find these:
...and print this:
This could happen multiple times in one file. For example, if these were the entries:
I'd like to print this:
Hello,
I have been searching the forum for concatenation based on condition. I have been close enough but not got th exact one.
infile:
-----DB_Name ABC (X,
Y,Z).
DB_Name DEF (T).
DB_Name GHI (U
,V,W).
Desired Output file should be:
---------------------------DB_Name ABC... (8 Replies)
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ?
The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories.
So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Hi,
I want to grep multiple patterns from multiple files and save to multiple outputs. As of now its outputting all to the same file when I use this command.
Input : 108 files to check for 390 patterns to check for. output I need to 108 files with the searched patterns.
Xargs -I {} grep... (3 Replies)
Hi
I have a file like
1 2
1 2 3
1 5 6
11 12
10 2
7 5
17 12
I would like to have an output as
1 2 3 5 6 10 7
11 12 17
any help would be highly appreciated
Thanks (4 Replies)
I have about 6000 files of the following format (three simplified examples shown; actual files have variable numbers of columns, but the same number of lines). I would like to concatenate the ID (*Loc*) and data lines, but not the others, as shown below. The result would be one large file (or... (3 Replies)
Hello,
I need to print some lines as explained below,
TXT example
1111
2222
3333
4444
5555
6666
7777
8888
6666
9999
1111
2222
3333
4444
5555 (8 Replies)
Hi all,
I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex:
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
LEARN ABOUT DEBIAN
netris
netris(6) Netris netris(6)NAME
netris - networked version of tetris
SYNOPSIS
netris [-wFDSCHR] [-c host] [-p port] [-k keys] [-i sec] [-r robot] [-s seed]
DESCRIPTION
The object of the game Tetris is to fit the shapes together forming complete rows, which then vanish. When the shapes fill up to the top,
the game ends. This version of Tetris can be played against other people over a network.
OPTIONS -w Wait for connection from another host running netris.
-c host
Initiate connection to waiting netris running on host.
-p port
Set the port number to use for connecting to netris, the default port is 9284.
-k keys
Remap keys, the argument is a prefix of the string containing the keys in order: left, rotate, right, drop, down-faster, toggle-spy-
ing, pause, faster, redraw and new game. Use the "^" character to prefixes controls. The default is to use "jkl mspf^ln".
-i sec
Set the step-down interval, in seconds.
-r robot
Execute robot (a command) as a robot controlling the game instead of the keyboard.
-F Use fair robot interface.
-s seed
Start with given random seed.
-D Drops go into drop mode, this means that sliding off a cliff after a drop causes another drop automatically.
-S Disable inverse/bold/color for slow terminals.
-C Disable color.
-H Show distribution and warranty information.
-R Show the rules of the game.
RULES
Two player mode
It's just like normal Tetris except that when you clear more than one row with a single piece, the other player's board is moved up and
junk rows are added to the bottom. If you clear 2, 3 or 4 rows, 1, 2 or 4 junk rows are added to your opponent's board, respectively. The
junk rows have exactly one empty column. For each group of junk rows given, the empty columns will line up. This is intentional.
The longest surviving player wins the game.
One player mode
This mode is currently very boring, because there's no scoring and it never gets any faster. This will be rectified at some point. I'm
not very motivated to do it right now because I'm sick of one player Tetris. For now, use the "f" key (by default) to make the game go
faster. Speed-ups cannot be reversed for the remainder of the game.
AUTHORS
Netris was written by Mark H. Weaver <mhw@netris.org>.
This manual page was written by Edward Betts <edward@debian.org>, for the Debian GNU/Linux system (but may be used by others).
0.5 3 Aug 2001 netris(6)