Lemme give a shot with explanin Scrutinizer code :
NF determines the number of fields per line.
Using that information, we can use i in a for loop with $ to evaluate each field string wise with our conditions. (NF is 4, so i is from 1 to 4, $1 being first field etc.)
awk considers record separator(RS) a line (if not stated otherwise).
So we introduce a w variable to process our conditions per line.
Everything is printed (again per line, if matched print changed if not print as is) as file is processed line by line.
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Hi,
I have a fixed width file.
The way this file works is say for example there are 30 columns in it each with different sizes say 10,5,2, etc...
If data in a field is less than the field size the rest of it is loaded with spaces.
I would like an awk command to that would replace
I have... (8 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Hi
cat test.txt
H|123|341|567|asfg
D|dfg|trtyy|errt
D|ert|frty|wer
Here I need to replace the third column value with 100 of the first record only and while printing I need to print the full file content also..I am expecting a result like this
H|123|100|567|asfg
D|dfg|trtyy|errt... (3 Replies)
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance (9 Replies)
Hi All,
I already have a code which replaces column 14 of NPBR.XTR.tmp with column 8 of NPBR3G.XTR.final
awk -F'\|' 'FNR==NR{a= $2"^"$8;next;}a{split(a,b,"^");$8=b;$14=b;}1' OFS="|" ${SHTEMP}NPBR3G.XTR.final ${SHTEMP}NPBR.XTR.tmp > ${SHTEMP}NPBR.XTR.final
I also need to replace column 15... (2 Replies)
Hi,
In a file we have the following data like as below
abcdef="cfg-1-15"
bmmdda-g-45-2
yhdiao"rtg-1-df-34"
I need a sed/awk command to replace the above string with empty.
Thx, (1 Reply)
Hi Forum.
I'm trying to cleanup the following data elements (To remove any occurences of commas and any extra spaces) while preserving the <TAB> delimiter using awk gsub but I have not been successful.
Original Data:
4365 monte des source rue,, ,<TAB>trevost<TAB>QC
Desired Data:... (1 Reply)
I have a csv which has lot of columns . I was looking for an awk script which would extract a column twice. for the first occurance the header and data needs to be intact but for the second occurance i want to replace the header name since it a duplicate and extract year value which is in ddmmyy... (10 Replies)
Hello Everyone,
I have many files like so:
file1.txt
file2.txt
file3.txt
Within each file I have many lines of random text separated by commas like so:
abcAAA,123,defAA,456777,ghiA,789
jklB,101,mnoBBB,11211,pqrB,13111
stuCC,415,vwxCCCC,161,yzaC,718
I am trying to use SED or AWK to... (4 Replies)
Discussion started by: D3U5X
4 Replies
LEARN ABOUT DEBIAN
torus-trooper
Torus Trooper(6) Torus Trooper(6)NAME
torus-trooper - speeding ship sailing through barrage
DESCRIPTION
Speed! More speed!
Torus Trooper is a fast-paced abstract scrolling shooter game. It features 3D graphics and a style similar to that of games such as Tem-
pest.
OPTIONS
These options are available:
-brightness n
Set the brightness of the screen.(n = 0 - 100, default = 100)
-luminosity n
Set the luminous intensity.(n = 0 - 100, default = 0)
-res x y
Set the screen resolution to (x, y).
-nosound
Stop the sound.
-window
Launch the game in a window.
-fullscreen
Launch the game in fullscreen mode.
-reverse
Reverse a shot key and a charge shot key.
USAGE
How to operate:
Movement
Arrow / Num / [WASD] / Joystick
Hold an up key to increase speed.
Shot [Z][L-Ctrl][.] / Trigger 1, 4, 5, 8
Hold a shot key to open automatic fire.
Charge shot
[X][L-Alt][L-Shift][/] / Trigger 2, 3, 6, 7
Hold a charge shot key to charge energy.
- A charge shot is released when you release a key.
- A charge shot penetrates enemies and wipes out bullets.
- A score multiplier is increased according to a number of destroying enemies and bullets.
- A charge shot acts as a regenerative break.
Pause [P]
How to play:
At the title screen, select a grade(Normal, Hard, Extreme) and a starting level. Press a shot button to start a game. Press an escape key
to quit a game.
Drive a ship forward and destroy enemies. When time runs out, game is over.
Remaining time is displayed at the left up corner.
Remaining time varies according to events:
Ship was destroyed(-15 sec.)
You ship is destroyed when it is hit by a bullet.
Bonus time(+15 sec.)
You can earn bonus time when you reach a certain score. The point you have to get is displayed at the right up corner.
Destroy the boss(+30 or 45 sec.)
The boss enemies appear when you destroy or overtake a certain number(displayed at the left down corner) of enemies, and you can
earn bonus time by destroying them.
Replay mode
At the title screen, press a charge shot key to see a replay of your last game. Press a left/right key to change a view and an
up/down key to change displayed/undisplayed of a status display.
SEE ALSO
You can find more about the game on its homepage: http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html
AUTHOR
This game has been written by Kenta Cho <cs8k-cyu@asahi-net.or.jp>
Torus Trooper(6)