List line count of multiple files in windows server 2012


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting List line count of multiple files in windows server 2012
# 1  
Old 11-01-2015
List line count of multiple files in windows server 2012

how to find out line count ( wc -l ) for multiple fines in windows cmd

the command which i a using to find line count for single file is

Code:
type sec0001.txt | find /c /v ""

but how to use it for multiple files

Quote:
for sec001.txt to sec999.txt
to get output filewise as if this command is run like

Code:
type sec*.txt | find /c /v ""

its gives output for summation all files

the desired output which i expect is
Quote:
file name line count
sec001.txt 12
sec002.txt 55
.
.
.
sec99.txt 45
thanks
# 2  
Old 11-01-2015
Try using a FOR loop:
Code:
FOR %i IN (sec*.txt) DO find %i /c /v ""

This User Gave Thanks to mjf For This Post:
# 3  
Old 11-02-2015
Thanks it works for me

I would like to know can we get file size also in same command
like
Quote:
current output is

"Filename.txt" "line count"

can we get

"filename.txt" "line count" "size of file"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

2. UNIX for Advanced & Expert Users

Authenticating with SSSD / Kerberos against Windows Server 2012 R2

I'm authenticating with SSSD / Kerberos against Windows Server 2012 R2. I've setup credentails delegation using these options: Host * GSSAPIAuthentication yes GSSAPIDelegateCredentials yes GSSAPITrustDns yes For both client/server but no luck. I've read online that I need to run... (2 Replies)
Discussion started by: Devyn
2 Replies

3. Shell Programming and Scripting

Copying the files to Windows server from UNIX server

Hi Team, I had a requirement to write a shell script which automatically transfer the files from unix server to windows server. I can able to unix to unix using Scp command. I am not sure how to do unix to windows. I am very new on this concept. Could you please help me or guide in... (4 Replies)
Discussion started by: gvkumar25
4 Replies

4. Solaris

FTP-ing files from Windows server to UNIX server

I need to transfer files from a Windows server to the Unix server and have to run some shell script on it to get the required output. Is it possible to transfer files from Windows server to unix server through any shell script? If so can you please help me with the details. Thanks in... (8 Replies)
Discussion started by: ssk250
8 Replies

5. AIX

How can we share a AIX drive on to Windows 2012 server?

Hi, How can we share a AIX drive on to Windows 2012 server. or vise versa. Note: Not using NFS/CIFS/samba. (*we are not able to use samba/NFS/CIFS for some reason) Requirement: How to have real time file sharing over the network between Windows and UNIX Do you guys have any ... (4 Replies)
Discussion started by: System Admin 77
4 Replies

6. Shell Programming and Scripting

gawk convert 2012-Jun-13 to 2012-06-13

I have a value in a file i am processing that has a date like "2012-Jun-13" how can I convert a date like that 2012-06-13? Am I stuck building an array of three digit months and corresponding numbers and running through the logic of figuring out the number?? or can I convert this with... (1 Reply)
Discussion started by: trey85stang
1 Replies

7. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

8. Shell Programming and Scripting

Extract string from multiple file based on line count number

Hi, I search all forum, but I can not find solutions of my problem :( I have multiple files (5000 files), inside there is this data : FILE 1: 1195.921 -898.995 0.750312E-02-0.497526E-02 0.195382E-05 0.609417E-05 -2021.287 1305.479-0.819754E-02 0.107572E-01 0.313018E-05 0.885066E-05 ... (15 Replies)
Discussion started by: guns
15 Replies

9. Shell Programming and Scripting

FTPing files from unix server to windows server

Hi, Below is the script which ftps the file from unix server and putting in a different directory(but on unix server) How can i ftp the files from unix server and to place in a secure location on windows server? what changes needs to be done to the below script? How can this be... (1 Reply)
Discussion started by: venkatesht
1 Replies

10. Solaris

how to get multiple files using sftp from a windows server

I need to get multiple files from a windows server to a solaris server using sftp, I tried it but only can get one file at a time ( I'm unable to use a wild card character using sftp) hoe do i do this. any light on this is appreciated. Ram. (3 Replies)
Discussion started by: ramky79
3 Replies
Login or Register to Ask a Question