Hi,
count=0
for file in `ls -1 ./trash`
do
count=`expr $count + 1`
echo "$count: $file" >> $menu_file
done
[code]
Take care of files with spaces. Use shell expansion instead
eg
. take note it will not list out hidden files. Use while loop if hidden files are required. eg
Can you help me please?
I know that
wc -l *.txt gives you the number of lines in each file. But how can i count the files that have over n lines? (4 Replies)
I am getting a few gzip files into a folder by doing ftp to another server. Once I get them I move them to another location .But before that I need to make sure each gzip is not more than 5000 lines and split it up . The files I get are anywhere from 500 lines to 10000 lines in them and is in gzip... (4 Replies)
Hello, I'm trying to create a BASH file that can read all the files in my working directory and tell me how many words and lines are in that file. I wrote the following code:
FILES="*"
for f in "$FILES"
do
echo -e `wc -l -w $f`
done
My issue is that my file is outputting in one... (4 Replies)
Hi,
plz see the below code.
here my aim is to calculate the number of lines in unprocessedData.out
if this file contains 40 lines then lastly $linenum should print 40.(except blank lines)
i have tried below code but it giving me the output only one. can anyone help me how to do ?
... (9 Replies)
Hi all,
I tried to use the paste command to paste two files with different number of lines.
e.g.
file1
A 1
B 1
C 2
D 2
file2
A 2
B 3
C 4
D 4
E 4 (2 Replies)
Hello Friends,
Can anyone help me for the below requirement.
I am having a file called Input.txt.
My requirement is first check the count that is wc -l input.txt
If the result of the wc -l Input.txt is less than 10 then don't split the Input.txt file. Where as if Input.txt >= 10 the split... (12 Replies)
Hi everyone,
I have two files, namely:
file1:
file1Col1Row1;file1Col2Row1;file1Col3Row1
file1Col1Row2;file1Col2Row2;file1Col3Row2
file1Col1Row3;file1Col2Row3;file1Col3Row3file2:
file2Col1Row1;file2Col2Row1;file2Col3Row1
file2Col1Row2;file2Col2Row2;file2Col3Row2... (0 Replies)
Dear All,
I would like to compare two files and return the number of matches found.
Example
File A
Lx2
L1_Mus1
L1Md_T
Lx5
L1M2
L1_Mus3
Lx3_Mus
Lx9
Lx2A
L1Md_A
L1Md_F2
File B
L1_Mus3
L1_Mus3 (3 Replies)
I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with:
wc -l *|sort
15263 Image.txt
16401 reference.txt
40459 richtexteditor.txt
How can I also print the number of unique lines in each file?
15263 1401 Image.txt
16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
LEARN ABOUT PLAN9
read
READ(5) File Formats Manual READ(5)NAME
read, write - transfer data from and to a file
SYNOPSIS
Tread tag[2] fid[2] offset[8] count[2]
Rread tag[2] fid[2] count[2] pad[1] data[count]
Twrite tag[2] fid[2] offset[8] count[2] pad[1] data[count]
Rwrite tag[2] fid[2] count[2]
DESCRIPTION
The read request asks for count bytes of data from the file identified by fid, which must be opened for reading, starting offset bytes
after the beginning of the file. Count must be less than or equal to MAXFDATA (8192, defined in <fcall.h>). The bytes are returned with
the read reply message.
The count field in the reply indicates the number of bytes returned. This may be less than the requested amount. If the offset field is
greater than the number of bytes in the file, a count of zero will be returned. For directories, read returns an integral number of direc-
tory entries exactly as in stat (see stat(5)), one for each member of the directory. The read request message must have offset and count
zero modulo DIRLEN.
The write request asks that count bytes of data be recorded in the file identified by fid, which must be opened for writing, starting off-
set bytes after the beginning of the file. If the file has been opened append only, the data will be placed at the end of the file regard-
less of offset. Directories may not be written.
The write reply records the number of bytes actually written. It is usually an error if this is not the same as requested.
ENTRY POINTS
Read and write messages are generated by the corresponding calls. Because of the MAXFDATA limit, more than one message may be produced by
a single call.
READ(5)