$ echo |awk ' BEGIN {"date" | getline current_time;close("date");print "Report printed on " current_time}'
Report printed on Thu May 11 14:57:29 METDST 2006
This example works fine but how can i print all the output when is longer... (3 Replies)
hello collegues,
I am attempting to use awk to search file1 (serverlist.csv) from each row with file2 (supported.txt). If the is no entry exists in serverlist then output to a file called notsupp.out if there is an entry output to supp.out
I can do this with basic shell scripting however... (0 Replies)
Hello,
Need some help here. I have this script (test.sh):
#!/bin/sh
var=$1
(( var = 2 * var ))
echo $var
Now I want to call this script from awk with one argument and then capture the result in a variable, something like:
echo 40 | awk ' { x = $1; "test.sh " x | getline y; print y }... (1 Reply)
How do you make the getline function return to the original line?
The example below should make it clear where I am currently going wrong.
Thanks
AWK SCRIPT:
-------------
awk -F '-' '{
tmpLine = "EMPTY"
print "CURRENT LINE :"$0
getline tmpLine
print "NEXT LINE :"tmpLine
}'... (1 Reply)
I am using awk and want to use getline from a file like below
getline x < file
However file consists of two columns and I only want to store $2
Any way I can do this?
---------- Post updated at 06:54 AM ---------- Previous update was at 06:45 AM ----------
Done something like this.... (1 Reply)
Hi there, I have an ifconfig output and i want to write a script that determines whether there is a line "groupname ipmp" on a particular interface
here is my example ifconfig -a output
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1... (2 Replies)
I want to import a textfile with getline into var t which has several lines. How do import all lines, since it only imports the last line:
while < ((getline t "textfile") > 0) (7 Replies)
Hello,
I want to print out the DNA sequence entries (tens of thousand!) that are longer than certain value (i=200) from a file (FASTA file) as:
>S94D_ctg_8004 Average coverage: 402.95
ATAATGCCTGTGAATATGACATGTGTTCCTGTTTCTACATCAGACTACTATTCTTGCATA... (12 Replies)
Hi,
I have an awk script with the following function in it .
function cmd( c )
{
while( ( c | getline foo) > 0 ){
return foo ;
close( c );
}
}
c =... (4 Replies)
Howdy Folks,
It seems like it is always awk that confuses the heck out of me and I even have books and examples.
I have this line:
awk '{if (/clientIP/)(SRV = $NF); if ($2 ~ /BUNDLE-GIM/) getline; if ($2 ~ /r100595/) {print SRV,"BUNDLE-GIM",$2}}' post.txt
to parse this text:
<api... (4 Replies)
Discussion started by: port43
4 Replies
LEARN ABOUT REDHAT
spottopgm
spottopgm(1L)spottopgm(1L)NAME
spottopgm - convert SPOT satellite images to Portable Greymap format
SYNTAX
spottopgm [-1|2|3] [Firstcol Firstline Lastcol Lastline] inputfile
OPTIONS
-1|2|3 Extract the given colour from the SPOT image. The colours are infra-red, visible light and ultra-violet, although I don't know
which corresponds to which number. If the image is in colour, this will be announced on standard error. The default colour is 1.
Firstcol Firstline Lastcol Lastline
Extract the specified rectangle from the SPOT image. Most SPOT images are 3000 lines long and 3000 or more columns wide. Unfortu-
nately the SPOT format only gives the width and not the length. The width is printed on standard error. The default rectangle is
the width of the input image by 3000 lines.
DESCRIPTION
Spottopgm converts the named inputfile into Portable Greymap format, defaulting to the first color and the whole SPOT image unless speci-
fied by the options.
INSTALLATION
You must edit the source program and either define BIG_ENDIAN or LITTLE_ENDIAN, and fix the typedefs for uint32_t, uint16_t and uint8_t
appropriately.
BUGS
Currently spottopgm doesn't determine the length of the input file; this would involve two passes over the input file. It defaults to 3000
lines instead.
Spottopgm could extract a three-color image (ppm), but I didn't feel like making the program more complicated than it is now. Besides,
there is no one-to-one correspondence between red, green, blue and infra-red, visible and ultra-violet.
I've only had a limited number of SPOT images to play with, and therefore wouldn't guarantee that this will work on any other images.
AUTHOR
Warren Toomey wkt@csadfa.cs.adfa.oz.au
SEE ALSO
The rest of the Pbmplus suite.
spottopgm(1L)