10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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)
Discussion started by: MetaMan
4 Replies
3. Shell Programming and Scripting
Hi,
how do i read a file using awk for a given no of line?
e.g
1. read only first 50 line.
2. read starting from line 20 to line 60..
thanks in advance.
-alva (8 Replies)
Discussion started by: alvagenesis
8 Replies
4. Shell Programming and Scripting
Greetings,
I have about 3000 files that I want to search. The first column in all of these 3000 files has a unique serial number on each line. The subsequent columns have lots of data.
I have another masterfile with three columns to help me find all the data I need in a moments notice:
col 1... (15 Replies)
Discussion started by: jeeplou
15 Replies
5. Shell Programming and Scripting
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)
Discussion started by: kristinu
1 Replies
6. Shell Programming and Scripting
I am using getline to read a file in a BEGIN block:
BEGIN {
while ((getline < "testFile.html") > 0) {
print $0 > "text.html"
}
}
The file is a normal HTML file. For some reason that I have not been able to discover in the text of the file, getline never finishes and the file is... (2 Replies)
Discussion started by: Enobarbus37
2 Replies
7. Shell Programming and Scripting
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)
Discussion started by: garethsays
1 Replies
8. Shell Programming and Scripting
I want to read a large (~1-4Gb) txt file with fields separated by "," and line separator "\n". Unfortunately, file contains \x00 (zero ASCII) symbols
AWK treats them as end of line + it ignores reminder of the line after the \x00.
As a simple example:
echo "\0060\0061\000\0060\0063" | nawk... (6 Replies)
Discussion started by: Murfury
6 Replies
9. UNIX for Dummies Questions & Answers
Hi,
The gcc compiler has warned about using gets(), so I've been trying my hand at getline.
Problem is that I've been able to read from a file, but what I really need is to read from a user's input.
I want to use getline like a scanf() command, but I can't figure what to substitute for the fp... (6 Replies)
Discussion started by: sdsd
6 Replies
10. Shell Programming and Scripting
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)
Discussion started by: chlawren
0 Replies