Sponsored Content
Full Discussion: count lines of file
Top Forums Shell Programming and Scripting count lines of file Post 302120410 by Shell_Life on Wednesday 6th of June 2007 10:44:59 AM
Old 06-06-2007
Panknil,
The only way to know how many lines a file has is to count
line by line, which is what "wc -l" does.
Anything else will use the same logic.
If it is taking too long, there is nothing else you can do.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count number of lines in Binary file

Hi Friends Please help me out to count number of lines in binary file. It gives some wrong(less) using wc -l. Is there any other way to count lines of binary file. Thanks. (3 Replies)
Discussion started by: vanand420
3 Replies

2. Programming

to count the number of commented lines in a file

can someone guide me how to have a C pgm to count the number of commented lines? (3 Replies)
Discussion started by: naan
3 Replies

3. Shell Programming and Scripting

Count lines between two patterns inside a file

Hi, Im doing a script to find the number of lines included inside a file newly. These lines are in between #ifdef FLAG1 and #else or #endif or #else and #endif. I tried like this, awk '/#ifdef Flag1/,/#e/{print}' aa.c | wc -l awk '/#ifndef Flag1/,/#endif/{print}' aa.c | awk... (6 Replies)
Discussion started by: priyadarshini
6 Replies

4. UNIX for Dummies Questions & Answers

Count of Number of Lines in a File

Dear Members, I want to count the number of lines in a file; for that i am using the following command : FILE_LINE_COUNT=`wc -l $INT_IN/$RAW_FILE_NAME` if i do an echo on FILE_LINE_COUNT then i get 241 /home/data/testfile.txt I don't want the directory path to be displayed. Variable... (1 Reply)
Discussion started by: sandeep_1105
1 Replies

5. Shell Programming and Scripting

Count the number of lines in a file with one condition

Hi Everyone, 1.txt Mon 08 Feb 2010 12:30:44 AM MYT;1265560244;e164:0000116047275464;T;Central;0; Mon 08 Feb 2010 12:30:46 AM MYT;1265560246;e164:0000116047275464;T;Central;0; Mon 08 Feb 2010 12:30:48 AM MYT;1265560248;e164:0000116047275464;T;Central;0; Mon 08 Feb 2010 12:30:50 AM... (1 Reply)
Discussion started by: jimmy_y
1 Replies

6. Shell Programming and Scripting

Trying to do a count on multiple lines in a file

Guys I am having a problem with being able to do a count of entries in a file. What I am trying to get a count of the total number of members that are listed in the files. So I need to pull the number of the lines after members. I tried using sed but it only seems to count the first... (7 Replies)
Discussion started by: scottzx7rr
7 Replies

7. Solaris

WC -l does not count all the lines in a file? HELP

I have a file that I need to merge with another like file. Normally I remove the trailer reocrd and merge the file and update the trailer record of the second file. I did a WC -l on the first file before I removed the trailer record, and again afterwards. The count came back the same. I opened the... (6 Replies)
Discussion started by: Harleyrci
6 Replies

8. Shell Programming and Scripting

Help with script to read lines from file and count values

Hi, I need some help with a script I'm trying to write. I have a log file containing references to a number of different webservices. I wish to write a script that will list the webservices with a count as to how many times they appear in the log. An example of the log file content: ... (2 Replies)
Discussion started by: gman2010
2 Replies

9. Shell Programming and Scripting

count lines in file to variable

I have a text file in which you need to identify the number of lines that looks like this: awk '{x + +} END {print x}' filename The problem is that I do not know how this data to any variable in which then need to continue to work in a cycle for .. do not know someone help? Sorry for my... (4 Replies)
Discussion started by: gizmo16
4 Replies

10. Shell Programming and Scripting

If file exists count lines

Hello, Currently I have: FILE=/home/file.txt if ; then echo "File $FILE exists" else echo "File $FILE does not exist" fi exit I would like to make it such that if the file *does* exist, it performs a wc -l count of the file and then if the count is greater than 3 performs... (3 Replies)
Discussion started by: holyearth
3 Replies
UUENCODE(5)						      BSD File Formats Manual						       UUENCODE(5)

NAME
uuencode -- format of an encoded uuencode file DESCRIPTION
Files output by uuencode(1) consist of a header line, followed by a number of body lines, and a trailer line. The uudecode(1) command will ignore any lines preceding the header or following the trailer. Lines preceding a header must not, of course, look like a header. The header line starts with the word ``begin'', a space, a file mode (in octal), a space, and finally a string which names the file being encoded. The central engine of uuencode(1) is a six-bit encoding function which outputs an ASCII character. The six bits to be encoded are treated as a small integer and added with the ASCII value for the space character (octal 40). The result is a printable ASCII character. In the case where all six bits to be encoded are zero, the ASCII backquote character ` (octal 140) is emitted instead of what would normally be a space. The body of an encoded file consists of one or more lines, each of which may be a maximum of 86 characters long (including the trailing new- line). Each line represents an encoded chunk of data from the input file and begins with a byte count, followed by encoded bytes, followed by a newline. The byte count is a six-bit integer encoded with the above function, representing the number of bytes encoded in the rest of the line. The method used to encode the data expands its size by 133% (described below). Therefore it is important to note that the byte count describes the size of the chunk of data before it is encoded, not afterwards. The six bit size of this number effectively limits the number of bytes that can be encoded in each line to a maximum of 63. While uuencode(1) will not encode more than 45 bytes per line, uudecode(1) will toler- ate the maximum line size. The remaining characters in the line represent the data of the input file encoded as follows. Input data are broken into groups of three eight-bit bytes, which are then interpreted together as a 24-bit block. The first bit of the block is the highest order bit of the first character, and the last is the lowest order bit of the third character. This block is then broken into four six-bit integers which are encoded one by one starting from the first bit of the block. The result is a four character ASCII string for every three bytes of input data. Encoded lines of data continue in this manner until the input file is exhausted. The end of the body is signaled by an encoded line with a byte count of zero (the ASCII backquote character `). Obviously, not every input file will be a multiple of three bytes in size. In these cases, uuencode(1) will pad the remaining one or two bytes of data with garbage bytes until a three byte group is created. The byte count in a line containing garbage padding will reflect the actual number of bytes encoded, making it possible to convey how many bytes are garbage. The trailer line consists of ``end'' on a line by itself. SEE ALSO
mail(1), uucp(1), uudecode(1), uuencode(1), ascii(7) HISTORY
The uuencode file format appeared in 4.0BSD. BUGS
The interpretation of the uuencode format relies on properties of the ASCII character set and may not work correctly on non-ASCII systems. BSD
April 9, 1997 BSD
All times are GMT -4. The time now is 06:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy