Description:
The AWK programming language.
|
|
|
Reading the whole file in one go in GAWK
|
| |
I have the need to read in the whole file as a single record in a GAWK
program. I seem to remember reading recently that there was some special
feature (recently added, sometime in the 4.x series) that supported this.
However, I could not find it in the doc (not that I searched exhaustively).... more »
|
|
Changing value in "for" loop
|
| |
Hi all,
I need to change the value of the "for" loop variable to reset it when a particular condition gets true.
Is it possible?
Thank you in advance for your answers.
|
|
sed range
|
| |
I need to replace a string within a range of lines starting from finding a mark(another string).
change "\xe2\x80\x8f" with "?" of lines 1,12 after finding a string "BarCode"
sed -e "/BarCode/,12s/\xe2\x80\x8f/?/ g" hold.out > soh.txt
|
|
Hitting Master Kaen with body armor as a monk
|
| |
Due to lack of magic resistance I wished for GDSM body armor to face
Master Kaen. With body armour and thus a to-hit penalty of -20 I wonder
how the odds are to hit him (with his base AC:-10). My luck should be
at maximum (if I haven't missed anything) and my stats are: St:18/41
Dx:23 Co:20 In:11 Wi:18 Ch:13 HP:176 Pw:127 AC:-30 Exp:21. I have no... more »
|
|
range extraction then based on a condtion
|
| |
Hello,
I am trying to extract a date range from a file and from that output display records when col2 is equal to PED.
I can do this using 2 awk statements, but would like to combined it in one statement.
How can I do thi?
thanks
PS
here is a a shortened file:
2013-02-10,PED
2013-02-11,GPS... more »
|
|
Making GAWK work right even in the awful world of i18n...
|
| |
I think I asked this before, but I can't remember exactly which answer I
got. So, please forgive...
Anyway, I just noticed (again) that GAWK (and presumably other, i18n-aware
versions of AWK - that is to say, probably anything that is more or less
"current") behaves weirdly (in terms of string comparisons and reg exp... more »
|
|
Internationalization (simple example section 10.5 gawk manual)
|
| |
Fri, 24 May 2013 13:07:53 -0700, bamberward did cat :
...
might be a side effect of your line wrapping non-technique ;-)
you may have some luck while looking up trees near
/usr/lib/locales/"yourlingo"/L C_MESSAGES/
/usr/share/locales/"yourlingo" /LC_MESSAGES/
but of course you're the best admin on your system and the actual roots may vary... more »
|
|
n00b PostScript files & decimal places
|
| |
This is probably really easy (I hope). I have been looking at awk for just over a week. This is a line from my data file: %SSiPrshPage: 0.00000 0.00000 198.00000 198.00000 0 1 0 0.00000 0.00000 0.00000 0.00000 16388 0.00000 1.00000 0.00000 1 0.00000 0.00000 1
$2 and $3 are the X and Y coordinates of this PS object. I need to add 97.92 to $2 and 131.76 to $3 for this object to be in the correct position. I need the output to have 5 decimal places. For simplicities sake I am testing just $2.... more »
|
|
awk or shell solution
|
| |
Hi
I have a file with just two lines as below :
hostname^Enclosure^Company^Mod el^Host^IP^Datacenter^CPU^RAM
hostname1^ENC0009^Company1^rx8 640^^10.130.120.10^Datacenter1 ^4^64G
I want the output as below:
hostname : hostname1
Enclosure : ENC0009
Company : Company1
Model : rx8640
Host :... more »
|
|
|