News Register Control Panel Private Messages Members List Team Search News Posts About Us

Linux Advisory » Q & A - Discussions » Programming & Coding » Counting rows » Hello Guest [login|register]
Last Post | First Unread Post Print Page | Recommend to Friend | Add Thread to Favorites
Pages (2): [1] 2 next » Post New Thread Post Reply
Author
Post « Previous Thread | Next Thread »
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Counting rows Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

This is kinda programming related problem so I posted this to this section.

Is there a software which could count all the rows in several text files? I'm coding my graduation work at this company and I would like to know how many total lines of code I have coded. Of course my editor let's me see the line count of a single file but since I have already 34 files in my work and plenty more coming it would be easier to have such a program which would count them at once.



07-10-2003 09:13 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
Ravish Ravish is a Male
Administrator




Registration Date: 12-27-2002
Posts: 703
Location: Internet
Linux Distro: Redhat, Mandrake, Gentoo

Rating:
15 Votes - Average Rating: 8.13

Level: 29 [?]
Experience Points: 211.826
Next Level: 242.754
30.928 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

I haven't used any tool or utility for windows. You can do that on linux by typing:

wc -l file1.txt file2.txt file3.txt

where file1.txt file2.txt file3.txt could be the names of your files. But, if you want to count all the files in the directory do this:

wc -l *

You can also try the following options for more fun:

-w counts only the number of words
-c counts only the number of characters



07-10-2003 09:42 Send an Email to Ravish Homepage of Ravish Search for Posts by Ravish Add Ravish to your Buddy List AIM Screenname: Ravi5h YIM Screenname: ravishahuja1
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

I just wish I had linux on my use Smile



07-10-2003 09:44 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
Ravish Ravish is a Male
Administrator




Registration Date: 12-27-2002
Posts: 703
Location: Internet
Linux Distro: Redhat, Mandrake, Gentoo

Rating:
15 Votes - Average Rating: 8.13

Level: 29 [?]
Experience Points: 211.826
Next Level: 242.754
30.928 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

quote:
Originally posted by Telos
I just wish I had linux on my use Smile

Why don't you install it right away? Its really cool. I recommend you to install Mandrake 9.1, Its very user friendly and very cool desktop interface.... even better than Windows XP.



07-10-2003 09:47 Send an Email to Ravish Homepage of Ravish Search for Posts by Ravish Add Ravish to your Buddy List AIM Screenname: Ravi5h YIM Screenname: ravishahuja1
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

I don't have any box to install it to at the moment. I don't want to install both linux and win to same one so I'll just wait until I buy a new computer so then I'll install one to this older box.



07-10-2003 14:56 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
Heather Heather is a Female
Respected Member




Registration Date: 05-21-2003
Posts: 511
Location: Lost City of Zen.
Linux Distro: I'm OS neutral.

Rating:
9 Votes - Average Rating: 3.67

Level: 25 [?]
Experience Points: 79.570
Next Level: 100.000
20.430 point(s) of experience needed for next level

OFFLINE

RE: Counting rows Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

quote:
Originally posted by Telos
This is kinda programming related problem so I posted this to this section.

Is there a software which could count all the rows in several text files? I'm coding my graduation work at this company and I would like to know how many total lines of code I have coded. Of course my editor let's me see the line count of a single file but since I have already 34 files in my work and plenty more coming it would be easier to have such a program which would count them at once.


Not that I know of on Windows. If you send me the files I'll do the line count for you.
It would only take me like 5 seconds.



Utinam logica falsa tuam philosophiam totam suffodiant

07-10-2003 16:34 Send an Email to Heather Search for Posts by Heather Add Heather to your Buddy List
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

heh, I can do the match myself too but it just takes time because there are so many files. So if I can't find a program I'll do the math by myself then but if you happen to see somewhere that kind of a program please let me know.



07-10-2003 17:48 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
Ravish Ravish is a Male
Administrator




Registration Date: 12-27-2002
Posts: 703
Location: Internet
Linux Distro: Redhat, Mandrake, Gentoo

Rating:
15 Votes - Average Rating: 8.13

Level: 29 [?]
Experience Points: 211.826
Next Level: 242.754
30.928 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

quote:
Originally posted by Telos
heh, I can do the match myself too but it just takes time because there are so many files. So if I can't find a program I'll do the math by myself then but if you happen to see somewhere that kind of a program please let me know.

Ok, I will...



07-10-2003 18:48 Send an Email to Ravish Homepage of Ravish Search for Posts by Ravish Add Ravish to your Buddy List AIM Screenname: Ravi5h YIM Screenname: ravishahuja1
nulldevice nulldevice is a Male
Administrator


Registration Date: 06-06-2003
Posts: 145
Location: Z10N

Rating:
7 Votes - Average Rating: 3.43

Level: 19 [?]
Experience Points: 20.326
Next Level: 22.851
2.525 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

why dont u try C..it can do the job very well.......
May i help?



-=-=-=-=-==-=-=-=-=-==-
rIDing hIGh oN tH3 sKy
-=-=-=-==-=-=-=-=-=-=-=-

07-11-2003 14:20 Send an Email to nulldevice Search for Posts by nulldevice Add nulldevice to your Buddy List Add nulldevice to your Contact List
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

so that I would code the program myself? yeah, I could do that with PHP too but I don't want to Smile and I don't have time



07-11-2003 15:56 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
nulldevice nulldevice is a Male
Administrator


Registration Date: 06-06-2003
Posts: 145
Location: Z10N

Rating:
7 Votes - Average Rating: 3.43

Level: 19 [?]
Experience Points: 20.326
Next Level: 22.851
2.525 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

well i can code that for u in C...but u have to make a few things clear.........



-=-=-=-=-==-=-=-=-=-==-
rIDing hIGh oN tH3 sKy
-=-=-=-==-=-=-=-=-=-=-=-

07-11-2003 22:36 Send an Email to nulldevice Search for Posts by nulldevice Add nulldevice to your Buddy List Add nulldevice to your Contact List
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

that would be awesome if you could do that _o/ Smile
just tell me what you want to know and I'll tell you. There should be nothing else than just option to add files to some list and then clicking the count button when it would count all the rows in the files which are in the list and show that count to user. Feature which gives you choice wheather empty lines count or not would be nice bonus too but not necessary.



07-11-2003 23:24 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
nulldevice nulldevice is a Male
Administrator


Registration Date: 06-06-2003
Posts: 145
Location: Z10N

Rating:
7 Votes - Average Rating: 3.43

Level: 19 [?]
Experience Points: 20.326
Next Level: 22.851
2.525 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

what abt doing it at command prompt...i am not familiar with VC++...i know C and would work on MSDOS...ie @ command propmt...how abt that.



-=-=-=-=-==-=-=-=-=-==-
rIDing hIGh oN tH3 sKy
-=-=-=-==-=-=-=-=-=-=-=-

07-12-2003 00:58 Send an Email to nulldevice Search for Posts by nulldevice Add nulldevice to your Buddy List Add nulldevice to your Contact List
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

so I would add the files via parameters? It's ok if you'll do it to work in MSDOS. Doesn't matter. The file adding to counting list is not necessary either. You could do it like it counts the lines from every file it finds in the folder specified.



07-12-2003 08:38 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
nulldevice nulldevice is a Male
Administrator


Registration Date: 06-06-2003
Posts: 145
Location: Z10N

Rating:
7 Votes - Average Rating: 3.43

Level: 19 [?]
Experience Points: 20.326
Next Level: 22.851
2.525 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

i am working on it....just facing a lil prob...nearly done...hope u will get it 2morrow..........actually my windws is broken....n i am to work on someones else sys according to his timings...so i have time 2morrow and will fix it and send it to u....



-=-=-=-=-==-=-=-=-=-==-
rIDing hIGh oN tH3 sKy
-=-=-=-==-=-=-=-=-=-=-=-

07-12-2003 19:28 Send an Email to nulldevice Search for Posts by nulldevice Add nulldevice to your Buddy List Add nulldevice to your Contact List
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

whoah, you're fast. Thank you so much for this.



07-12-2003 21:29 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
nulldevice nulldevice is a Male
Administrator


Registration Date: 06-06-2003
Posts: 145
Location: Z10N

Rating:
7 Votes - Average Rating: 3.43

Level: 19 [?]
Experience Points: 20.326
Next Level: 22.851
2.525 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

soory buddy u cant get it today.....but believe me its just a few mins job left...the prob is my creeping sys....fixing it today...i think u must have a few days before u need it



-=-=-=-=-==-=-=-=-=-==-
rIDing hIGh oN tH3 sKy
-=-=-=-==-=-=-=-=-=-=-=-

07-13-2003 18:29 Send an Email to nulldevice Search for Posts by nulldevice Add nulldevice to your Buddy List Add nulldevice to your Contact List
Telos Telos is a Male
Super Moderator


Registration Date: 06-04-2003
Posts: 130
Location: Finland
Linux Distro: hmm....

Rating:
3 Votes - Average Rating: 7.00

Level: 19 [?]
Experience Points: 18.487
Next Level: 22.851
4.364 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

yes, no hurry at all. Just take your time.



07-13-2003 18:51 Send an Email to Telos Homepage of Telos Search for Posts by Telos Add Telos to your Buddy List Add Telos to your Contact List AIM Screenname: dreamimpactcom
Ravish Ravish is a Male
Administrator




Registration Date: 12-27-2002
Posts: 703
Location: Internet
Linux Distro: Redhat, Mandrake, Gentoo

Rating:
15 Votes - Average Rating: 8.13

Level: 29 [?]
Experience Points: 211.826
Next Level: 242.754
30.928 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

Also send me a copy when done, I'll like to try it out.



07-14-2003 17:43 Send an Email to Ravish Homepage of Ravish Search for Posts by Ravish Add Ravish to your Buddy List AIM Screenname: Ravi5h YIM Screenname: ravishahuja1
Ravish Ravish is a Male
Administrator




Registration Date: 12-27-2002
Posts: 703
Location: Internet
Linux Distro: Redhat, Mandrake, Gentoo

Rating:
15 Votes - Average Rating: 8.13

Level: 29 [?]
Experience Points: 211.826
Next Level: 242.754
30.928 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

Today, I recieved the application in my mailbox. It would be great if nulldevice could post a zip file as an attachment over here so that everyone could benifit.



07-20-2003 13:47 Send an Email to Ravish Homepage of Ravish Search for Posts by Ravish Add Ravish to your Buddy List AIM Screenname: Ravi5h YIM Screenname: ravishahuja1
Post Reply:
Title (Optional):
Message:


Convert URLs: Automatically converts internet addresses into links by adding [url] and [/url] around them.
Email Notification: Notifies you by email every time there is a new post in this thread.
Deactivate smilies in this post.
Add Signature: Displays your signature in this post.


Pages (2): [1] 2 next » Tree Structure | Board Structure
Post New Thread Post Reply
Go to:


Powered by Burning Board 2.0.2 © 2001-2002 WoltLab GbR
English Translation by Satelk