01-17-2014
Thank you, I was easily able to adapt this to my data and it works perfectly.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello. First time poster here. I have a huge file of IP numbers. I am trying to output only the class b of the IPs and rank them by most common and output the total # of duplicate class b's before the class b. An example is below:
12.107.1.1
12.107.9.54
12.108.3.89
12.109.109.4
12.109.6.3
... (2 Replies)
Discussion started by: crunchtime
2 Replies
2. Linux
Hello,
I have afile which begins with a few urls on multiple lines and then there is listing of some information on separate lines.
The listing begins with the word Name on a given line followed by teh actual list.
I want to count the number of lines in this file after the line having... (6 Replies)
Discussion started by: nayeemmz
6 Replies
3. Shell Programming and Scripting
Hi All
I have the input file OMAK_11.
OMAK 000002EXCLUDE 1341
OMAK 000002EXCLUDE 1341
OMAK 000002EXCLUDE 1341
OMAK 000003EXCLUDE 1341
OMAK 000003EXCLUDE 1341
OMAK 000003EXCLUDE ... (8 Replies)
Discussion started by: dhanamurthy
8 Replies
4. Shell Programming and Scripting
Hi all,
I use bash shell and I have a problem with wc.
I would like to determine the number of lines in a file so I do
wc -l filename
but I don't want to get the filename again
I just would like to have the number of lines and use it in a variable.
Can anybody help?
Thank you, (7 Replies)
Discussion started by: f_o_555
7 Replies
5. Shell Programming and Scripting
Hello everybody,
I'm trying to count the number of consecutive lines in a text file which have two distinctive column field values. These lines may appear in several line blocks within the file, but I only want a single block to be counted.
This was my first approach to tackle the problem (I'm... (6 Replies)
Discussion started by: origamisven
6 Replies
6. Shell Programming and Scripting
/bin/sed -n ';4757335,$ p' | wc -l
/bin/sed -n ';4757335,$ p' | egrep "Failed" | egrep -c "PM late arrrival"
how can i combine the above two sed commands into one? i want to count the number of lines between the specified line number and the end of the file. AND and i want to count how many... (5 Replies)
Discussion started by: SkySmart
5 Replies
7. Shell Programming and Scripting
Hi,
I have a file which has the contents:
sh-4.2# pwd
/tmp
sh-4.2# cat servernfiles
server1 /var/tmp/file
server2 /var/tmp/file1
I want to manage each line one after the other. I have this basic script :
#!/bin/sh
HOST=`cat /tmp/servernfiles | awk '{print $1}'`
CMD=`cat... (6 Replies)
Discussion started by: chandika_diran
6 Replies
8. Shell Programming and Scripting
I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies
9. Shell Programming and Scripting
Hello,
I would like to ask for help with csh script.
An example of an input in .txt file is below, the number of lines varies from file to file and I have 2 or 3 columns with values. I would like to read all the values (probably one by one) and set them to independent unique variables that... (7 Replies)
Discussion started by: FMMOLA
7 Replies
10. Shell Programming and Scripting
So I have several files (35000, to be exact) in the format rmsd_protein_*.dat each with 2 columns and 35000 rows.
I would like to count how many values in the second column are less than 3 for each file, and output it into a new file so that it ultimately appears as:
1 14057
2 ... (12 Replies)
Discussion started by: Alexandryne
12 Replies
LEARN ABOUT PHP
socket_write
SOCKET_WRITE(3) 1 SOCKET_WRITE(3)
socket_write - Write to a socket
SYNOPSIS
int socket_write (resource $socket, string $buffer, [int $length])
DESCRIPTION
The function socket_write(3) writes to the $socket from the given $buffer.
PARAMETERS
o $socket
-
o $buffer
- The buffer to be written.
o $length
- The optional parameter $length can specify an alternate length of bytes written to the socket. If this length is greater than
the buffer length, it is silently truncated to the length of the buffer.
RETURN VALUES
Returns the number of bytes successfully written to the socket or FALSE on failure. The error code can be retrieved with
socket_last_error(3). This code may be passed to socket_strerror(3) to get a textual explanation of the error.
Note
It is perfectly valid for socket_write(3) to return zero which means no bytes have been written. Be sure to use the === operator to
check for FALSE in case of an error.
NOTES
Note
socket_write(3) does not necessarily write all bytes from the given buffer. It's valid that, depending on the network buffers etc.,
only a certain amount of data, even one byte, is written though your buffer is greater. You have to watch out so you don't uninten-
tionally forget to transmit the rest of your data.
SEE ALSO
socket_accept(3), socket_bind(3), socket_connect(3), socket_listen(3), socket_read(3), socket_strerror(3).
PHP Documentation Group SOCKET_WRITE(3)