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. UNIX for Dummies Questions & Answers
I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies
4. Shell Programming and Scripting
I have 84 files with the following names splitseqs.1, spliseqs.2 etc.
and I want to change the .number to a unique filename.
E.g.
change splitseqs.1 into splitseqs.7114_1#24
and
change spliseqs.2 into splitseqs.7067_2#4
So all the current file names are unique, so are the new file names.... (1 Reply)
Discussion started by: avonm
1 Replies
5. Programming
Hi All,
When I do man getline on my Linux system (in BASH), I see an example C code where a file is being read using getline() function.
Now, my question is why there is no fclose() to close the open file pointer?
People who don't have a Linux system, this is the code that I am referring... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
6. Programming
I can not get 'getline()' to compile. I have tried.
string curLine; //= compiler error
char* curLine; //=compiler error
char curLine; //=compiler error
Every example I see uses a string as a getline(); parameter. It does not work for me on Fedora14 with gcc-c++. Thank you so much. This... (1 Reply)
Discussion started by: sepoto
1 Replies
7. Shell Programming and Scripting
i wrote following script to test getline
BEGIN{
while ( "who" | getline > 0)
nr++
print nr
}
when i run this script as
awk -f scriptname (2 Replies)
Discussion started by: asalman.qazi
2 Replies
8. Shell Programming and Scripting
I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM".
I can find the line number for the beginning of the statement section with sed.
... (5 Replies)
Discussion started by: andrewsc
5 Replies
9. Programming
I have a C program I've written that includes a 'getline' call that is used to read a line at a time from a file and process the information in each line. A potential problem comes up since I don't know the maximum length of each line; right now I'm using a constant of 256, but that might not be... (2 Replies)
Discussion started by: cleopard
2 Replies
10. UNIX for Dummies Questions & Answers
hi , I got a script that I don't understand.
awk '{
command="echo "$1
command | getline echome
close(command)
print $0 "\t" echome
}' < user.list
It reads the file user.list
user.list
London John
Bridge Peter
and sends the stream to the awk command.
I don't understand what is... (3 Replies)
Discussion started by: remid1985
3 Replies