Re: wc user error?

2010-02-21 Thread Philip Rowlands
On Sat, 20 Feb 2010, Faheem Mitha wrote: I'm puzzled by this. What am I missing here? Regards, Faheem. fah...@avicenna:/home/cj35$ wc -l snpdb/illumina_cj35.fg_40101.map 620902 snpdb/illumina_cj35.fg_40101.map fah...@avicenna:/home/cj35$ wc -l /home/cj35/snpdb/illumi

Re: wc user error?

2010-02-20 Thread Faheem Mitha
On Sat, 20 Feb 2010, Andreas Schwab wrote: Faheem Mitha writes: On Sat, 20 Feb 2010, Andreas Schwab wrote: Faheem Mitha writes: wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory ^ That character looks like a space, but is a no-break space character (U00

Re: wc user error?

2010-02-20 Thread Faheem Mitha
On Sat, 20 Feb 2010, Andreas Schwab wrote: Faheem Mitha writes: wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory ^ That character looks like a space, but is a no-break space character (U00A0). Wow. Nice catch. Just FYI, how did you detect this?

Re: wc user error?

2010-02-20 Thread Andreas Schwab
Faheem Mitha writes: > On Sat, 20 Feb 2010, Andreas Schwab wrote: > >> Faheem Mitha writes: >> >>> wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory >> ^ >> >> That character looks like a space, but is a no-break space character >> (U00A0). > > Wow. Nice catch. Jus

Re: wc user error?

2010-02-20 Thread Andreas Schwab
Faheem Mitha writes: > wc:  /home/cj35/snpdb/illumina_cj35.fg_40101.map: No such file or directory ^ That character looks like a space, but is a no-break space character (U00A0). Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5

Re: wc

2009-06-12 Thread iram chelli
Thank you Giuseppe, I have switched to wc -w |cur -d ' ' -f 1 Regards, Iram. Giuseppe Scrivano a écrit : Hello, if you need a specific wc output field, the words count in this case, you can use the command `wc -w FILE'. Is it what you want? Regards, Giuseppe Iram CHELLI writes: Hello,

Re: wc

2009-06-12 Thread iram chelli
Pádraig Brady a écrit : Pádraig Brady wrote: You probably want to squeeze adjacent blanks: wc FILE | tr -s '[:blank:]' ' ' | cut -d' ' -f2 Note you might wonder why cut doesn't support -d'[:blank:]' to auto skip runs of horizontal whitespace. Details here: http://lists.gnu.org/archive/html/b

Re: wc

2009-06-12 Thread iram chelli
Bob Proulx a écrit : Iram CHELLI wrote: wc FILE | cut -d " " -f 2 it usually works but sometimes wc outputs the result in a different formatting, that is, I have to do a cut -d " " -f 3 to get the wc. The output format for the wc on different systems will produce a differing number of l

Re: wc

2009-06-12 Thread iram chelli
Pádraig Brady a écrit : Iram CHELLI wrote: Hello, i am using wc in shell scripts the exact command is: wc FILE | cut -d " " -f 2 You probably want to squeeze adjacent blanks: wc FILE | tr -s '[:blank:]' ' ' | cut -d' ' -f2 cheers, Pádraig. Thank you this is great. Cheers, Iram.

Re: wc

2009-06-12 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Pádraig Brady on 6/12/2009 8:00 AM: > Note also that wc can output particular counts in isolation. > I.E. this will get the same affect as your original: > > wc -w FILE | cut -d' ' -f1 Even better: wc -w < FILE - -- Don't work too hard

Re: wc

2009-06-12 Thread Giuseppe Scrivano
Hello, if you need a specific wc output field, the words count in this case, you can use the command `wc -w FILE'. Is it what you want? Regards, Giuseppe Iram CHELLI writes: > Hello, > > > i am using wc in shell scripts > > the exact command is: > > wc FILE | cut -d " " -f 2 > > it usual

Re: wc

2009-06-12 Thread Pádraig Brady
Pádraig Brady wrote: > > You probably want to squeeze adjacent blanks: > > wc FILE | tr -s '[:blank:]' ' ' | cut -d' ' -f2 Note you might wonder why cut doesn't support -d'[:blank:]' to auto skip runs of horizontal whitespace. Details here: http://lists.gnu.org/archive/html/bug-coreutils/2009-0

Re: wc

2009-06-12 Thread Bob Proulx
Iram CHELLI wrote: > wc FILE | cut -d " " -f 2 > > it usually works but sometimes wc outputs the result in a different > formatting, that is, I have to do a cut -d " " -f 3 to get the wc. The output format for the wc on different systems will produce a differing number of leading spaces. Co

Re: wc

2009-06-12 Thread Pádraig Brady
Iram CHELLI wrote: > Hello, > > > i am using wc in shell scripts > > the exact command is: > > wc FILE | cut -d " " -f 2 You probably want to squeeze adjacent blanks: wc FILE | tr -s '[:blank:]' ' ' | cut -d' ' -f2 cheers, Pádraig. ___ Bug-co

Re: wc support for different tab widths

2009-06-04 Thread Bob Proulx
Pádraig Brady wrote: > Bob Proulx wrote: > > The threshold for adding single letter options is pretty high. To do > > that would need pretty strong reasons. So it would be unlikely that > > a -L option would get added. Long options are available however. > > Bob, -L exists and basically selects

Re: wc support for different tab widths

2009-06-04 Thread Pádraig Brady
Bob Proulx wrote: > Hello Sebastian, > > Sebastian Bozlee wrote: >> I'm sorry if this is the wrong place to post this. > > This is the right place for discussion about 'wc' and development for > it. Along with any of the other coreutils. > >> This is my first contribution to an open source proj

Re: wc support for different tab widths

2009-06-03 Thread Bob Proulx
Hello Sebastian, Sebastian Bozlee wrote: > I'm sorry if this is the wrong place to post this. This is the right place for discussion about 'wc' and development for it. Along with any of the other coreutils. > This is my first contribution to an open source project, so feedback > is appreciated.

Re: wc enhancement request: total option

2009-02-13 Thread Philip Rowlands
On Fri, 13 Feb 2009, Kevin Ivory wrote: Hi coreutils team, wc gives a grand total when analyzing several files. It would be helpful to have a command line option that returns only the total. It should be able to combine with -c/-l/-w to return only the total characters / total lines / total wor

Re: wc -l doesn't count partial lines

2009-01-25 Thread wagnerdm
Quoting Bob Proulx : Thanks for the report. However that is the way it is supposed to work. The 'wc -l' command counts the number of newline characters in Aw, shucks. Sorry for the spurious traffic, then. It's a shame it doesn't work the way I want it to... but specs are important. =)

Re: wc -l doesn't count partial lines

2009-01-25 Thread Bob Proulx
wagne...@seas.upenn.edu wrote: > If a file has no newline at the end of the last line, the last line > doesn't get counted. Thanks for the report. However that is the way it is supposed to work. The 'wc -l' command counts the number of newline characters in the file. It can't count missing ne

Re: wc -l doesn't count partial lines

2009-01-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to wagne...@seas.upenn.edu on 1/25/2009 9:15 AM: > If a file has no newline at the end of the last line, the last line > doesn't get counted. As a minimal test case, try > > % echo foo >test && echo -n bar >>test && wc -l test > 1 Not a bu

Re: wc command

2008-12-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Jim Meyering on 12/22/2008 10:57 AM: >>> It would be possible to add a conditional check, where if POSIXLY_CORRECT >>> is not defined in the environment and a filter app is started with a tty >>> as stdin and stderr (ie. the same criteria

Re: wc command

2008-12-22 Thread Jim Meyering
Pádraig Brady wrote: > Eric Blake wrote: >> According to Andrew McGill on 12/22/2008 1:38 AM: >>> My guess is that while it would be friendly to provide a similar message for >>> wc (od, head, tail, etc), it would violate something posixy (and is >>> therefore >>> imposixable). >> >> It would be

Re: wc command

2008-12-22 Thread Pádraig Brady
Eric Blake wrote: > According to Andrew McGill on 12/22/2008 1:38 AM: >> My guess is that while it would be friendly to provide a similar message for >> wc (od, head, tail, etc), it would violate something posixy (and is >> therefore >> imposixable). > > It would be possible to add a conditiona

Re: wc command

2008-12-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Andrew McGill on 12/22/2008 1:38 AM: > My guess is that while it would be friendly to provide a similar message for > wc (od, head, tail, etc), it would violate something posixy (and is therefore > imposixable). It would be possible to

Re: wc command

2008-12-22 Thread Andrew McGill
On Wednesday 17 December 2008 15:07:43 Pádraig Brady wrote: > chakrapani.chittabathina wrote: > > Hi, > > First, we are grateful to you for your contribution towards this great > > open source project. > > Bug : when i am using "wc" command, i've entered only wc without any > > option and file na

Re: wc command

2008-12-17 Thread Pádraig Brady
chakrapani.chittabathina wrote: > Hi, > First, we are grateful to you for your contribution towards this great > open source project. > Bug : when i am using "wc" command, i've entered only wc without any > option and file name even, acidently, then it didn't give any error > report, even not giv

Re: wc command

2008-12-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to chakrapani.chittabathina on 12/17/2008 1:06 AM: Hello Chakrapani, > Bug : when i am using "wc" command, i've entered only wc without any > option and file name even, acidently, then it didn't give any error > report, even not giving help

RE: wc -m count is wrong

2008-07-07 Thread Hossain, Syed
ossain, Syed Cc: Bob Proulx; bug-coreutils@gnu.org Subject: Re: wc -m count is wrong On Thu, Jul 3, 2008 at 8:27 PM, Hossain, Syed <[EMAIL PROTECTED]> wrote: > Bob > > Thanks for getting back to me promptly. I can understand now why wc > increasing it by one but it is obviously, t

RE: wc -m count is wrong

2008-07-07 Thread Hossain, Syed
the issues. Syed -Original Message- From: Andreas Schwab [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2008 5:50 AM To: Hossain, Syed Cc: Bob Proulx; bug-coreutils@gnu.org Subject: Re: wc -m count is wrong "Hossain, Syed" <[EMAIL PROTECTED]> writes: > I can un

Re: wc -m count is wrong

2008-07-04 Thread Andreas Schwab
"Hossain, Syed" <[EMAIL PROTECTED]> writes: > I can understand now why wc increasing it by one It does not do that. It just does not ignore any character. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key finger

Re: wc -m count is wrong

2008-07-04 Thread James Youngman
On Thu, Jul 3, 2008 at 8:27 PM, Hossain, Syed <[EMAIL PROTECTED]> wrote: > Bob > > Thanks for getting back to me promptly. I can understand now why wc > increasing it by one but it is obviously, the explanation you gave me > should be documented in man page or info page, agreed? Thanks. How should

RE: wc -m count is wrong

2008-07-03 Thread Hossain, Syed
, July 03, 2008 2:14 PM To: Hossain, Syed Cc: bug-coreutils@gnu.org Subject: Re: wc -m count is wrong Hossain, Syed wrote: > I am surprised that I could not found any posting related to this, Here is a recent one. :-) http://lists.gnu.org/archive/html/bug-coreutils/2008-04/msg00238.h

Re: wc -m count is wrong

2008-07-03 Thread Bob Proulx
Hossain, Syed wrote: > I am surprised that I could not found any posting related to this, Here is a recent one. :-) http://lists.gnu.org/archive/html/bug-coreutils/2008-04/msg00238.html > /home/shossain$ echo 1234 | wc -m > 5 > Obviously I was expecting a count of 4 but wc printed out 5. I ha

Re: wc

2008-06-05 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Patrick McCrae on 6/5/2008 4:57 AM: | Hi, there - | | I know it is not a bug in the wc utility ... but maybe you also handle | feature requests (if you don't, please let me know where to address them | to). This is the right place. | |

RE: wc -l is not working the way it should

2008-01-17 Thread Rahman, Syed A
Thanks Bob, much appreciated. Thanks Syed -Original Message- From: Bob Proulx [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 7:11 PM To: Rahman, Syed A [CMB-IT] Cc: bug-coreutils@gnu.org Subject: Re: wc -l is not working the way it should Rahman, Syed A wrote: > The

Re: wc -l is not working the way it should

2008-01-16 Thread Bob Proulx
Rahman, Syed A wrote: > The wc seems not working correctly, say for example > wc -l filename | cut -c1-8 > should only give the lines, but this your version of wc, behaves > differently. for small size files it does not reserve first 8 colums for > size so get the file name as well Thank you for

Re: wc -l is not working the way it should

2008-01-16 Thread Steven Schubiger
Rahman, Syed A <[EMAIL PROTECTED]> wrote: > The wc seems not working correctly, say for example > wc -l filename | cut -c1-8 > should only give the lines, but this your version of wc, behaves > differently. for small size files it does not reserve first 8 colums for > size so get the file name as

Re: wc: Dutch translation and some suggestions

2007-06-26 Thread James Youngman
On 6/26/07, Hans Lodder <[EMAIL PROTECTED]> wrote: I use wc to check the complexity of webpages, so the number of words, word length and the number of words per sentence are important issues. wc helps me, and knowing the number of sentences would definitely be an advantage I would suggest that

Re: wc: Dutch translation and some suggestions

2007-06-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Hans Lodder on 6/26/2007 3:48 AM: > Hi! some suggestions for the translation: Thanks for the report. First off, translation bugs should be sent to the translator: http://www.iro.umontreal.ca/translation/registry.cgi?domain=coreutils htt

Re: wc: billion "incomplete multibyte" warnings

2006-11-27 Thread Matthew Woehlke
Dan Jacobson wrote: Anyway, I bet the standards document that you are trying to match doesn't say you need to fill one's xterm buffer like that. Don't count on it. I've seen some non-intuitive warnings required by POSIX (which, btw, you should know is "the standards document that [we] are try

Re: Wc documentation bug

2006-08-21 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Please keep replies on the list, if you think others would be interested in this information. According to Gustafsson on 8/18/2006 6:27 AM: > Thanks Eric > > Googling on "windows line count gnu" will this this page first: > http://gnuwin32.sourcefor

Re: Wc documentation bug

2006-08-18 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Gustafsson on 8/18/2006 3:17 AM: > Wc --help is incorrect regarding to wich output is displayed in which column. > > It says "Print byte, word, and newline counts" but the output is in newline, > word, and bytes. Time for you to upgra

Re: wc command

2005-05-13 Thread Paul Eggert
"Sebastian, Susan M" <[EMAIL PROTECTED]> writes: > The man pages says the wc command will > "wc - print the number of bytes, words, and lines in files", Thanks, but this doesn't seem to be in the latest coreutils CVS; perhaps you're talking about an older version of the man pages? ___

Re: wc can not count very large file

2004-10-07 Thread pwu
Philip Rowlands wrote: On Thu, 7 Oct 2004 [EMAIL PROTECTED] wrote: find . -name '*.[ch]' -print0 | xargs -r0 wc -l | grep -Ev "^[ ]+ [0-9]+ total" | tr -s ' ' | cut -f2 -d' ' | (tr '\n' +; echo 0) | bc I name that tune in 3: find . -type f -name '*.[ch]' -print0 | xargs -r0 -n1 wc -l | awk

Re: wc can not count very large file

2004-10-07 Thread Philip Rowlands
On Thu, 7 Oct 2004 [EMAIL PROTECTED] wrote: >find . -name '*.[ch]' -print0 | >xargs -r0 wc -l | >grep -Ev "^[ ]+ [0-9]+ total" | >tr -s ' ' | >cut -f2 -d' ' | >(tr '\n' +; echo 0) | >bc I name that tune in 3: find . -type f -name '*.[ch]' -print0 | xargs -r0 -n1 wc -l | awk '{total += $1} END {pr

Re: wc can not count very large file

2004-10-07 Thread P
Jim Meyering wrote: [EMAIL PROTECTED] wrote: Jim Meyering wrote: ... Once that option is added, you'll be able to do this: find . -name '*.[ch]' -print0 |wc --files0-from In the mean time, you could use your xargs command and sum the numbers from the `total' lines. The following should do that aut

Re: wc can not count very large file

2004-10-07 Thread Jim Meyering
[EMAIL PROTECTED] wrote: > Jim Meyering wrote: ... >> Once that option is added, you'll be able to do this: >> find . -name '*.[ch]' -print0 |wc --files0-from >> In the mean time, you could use your xargs command >> and sum the numbers from the `total' lines. > > The following should do that auto

Re: wc can not count very large file

2004-10-07 Thread P
Jim Meyering wrote: pwu <[EMAIL PROTECTED]> wrote: I have tried to calculate how many lines in our project. In one directory it give me the value is 160k, but the total number for all directories are only 50k. my command is like this: find . -name '*.[ch]' |xargs wc The newlines are only 50K. I ha

Re: wc can not count very large file

2004-10-07 Thread Jim Meyering
pwu <[EMAIL PROTECTED]> wrote: > I have tried to calculate how many lines in our project. In one > directory it give me the value is 160k, but the total number for all > directories are only 50k. > my command is like this: > find . -name '*.[ch]' |xargs wc > The newlines are only 50K. I have about

Re: wc -m reports one too many?

2004-05-09 Thread Tobias Reif
On Sat 2004-05-08 Bob Proulx wrote: > Andreas Schwab wrote: > > Tobias Reif <[EMAIL PROTECTED]> writes: > > > > > echo f | wc -m > > > > > > should yield 1. > > > > No, you forgot to count the newline. > > > > $ printf f | wc -m > > 1 > > For more information use 'od' to dump each character f

Re: wc -m reports one too many?

2004-05-08 Thread Bob Proulx
Andreas Schwab wrote: > Tobias Reif <[EMAIL PROTECTED]> writes: > > > echo f | wc -m > > > > should yield 1. > > No, you forgot to count the newline. > > $ printf f | wc -m > 1 For more information use 'od' to dump each character for your inspection. echo f | od -c 000 f \n

Re: wc -m reports one too many?

2004-05-08 Thread Andreas Schwab
Tobias Reif <[EMAIL PROTECTED]> writes: > echo f | wc -m > > should yield 1. No, you forgot to count the newline. $ printf f | wc -m 1 Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756

Re: wc v. 4.5.3

2004-02-03 Thread Paul Eggert
Jeff Martens <[EMAIL PROTECTED]> writes: > wc: /mnt/floppy/teaching.pdf:2447: Invalid or incomplete multibyte or wide character I think this bug is fixed in the latest coreutils ; if not, please let us know the details. _

Re: wc v. 4.5.3

2004-02-02 Thread Bob Proulx
Jeff Martens wrote: > wc version 4.5.3 is produces the following error message: Thank you for taking the time to report this problem. > wc: /mnt/floppy/teaching.pdf:2447: Invalid or incomplete multibyte or wide character > > wc is supposed to count lines, words, and bytes, and so should not > ev

Re: wc annoyances

2003-07-20 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Anyway, I noticed on glitch in the merged version; here's a patch. > > 2003-07-20 Paul Eggert <[EMAIL PROTECTED]> > > * src/wc.c (get_input_fstatus): Fix typo: `stat' was being > invoked with a null pointer when there were no file arguments.

Re: wc annoyances

2003-07-20 Thread Paul Eggert
Jim Meyering <[EMAIL PROTECTED]> writes: > Not that it matters, but in some unusual cases, > the new widths are worse than the old: > > $ dd bs=1 seek=1G of=b < /dev/null 2> /dev/null > $ ./wc -lw b >0 0 b > $ wc -lw b > 0 0 b Yes, that's true. The only

Re: wc annoyances

2003-07-20 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: ... > However, I agree with you that the leading spaces are annoying; this > has bitten me as well, in other examples. I looked into this, and it > turns out that the coreutils documentation is incorrect about what > POSIX requires for 'wc'. When this misund

Re: wc annoyances

2003-07-20 Thread Paul Eggert
Daniel Russell <[EMAIL PROTECTED]> writes: > [ `cat autolist-next.num` -gt `wc -l autolist.txt` ] That's easy enough to fix by using `wc -l wc count field widths now are heuristically adjusted depending on the input size, if known. If only one count is printed, it is gu

Re: wc annoyances

2003-07-19 Thread Paul Jarc
Daniel Russell <[EMAIL PROTECTED]> wrote: > Using wc in scripts is annoying because of the fact that this: > > wc -l/m/c FILENAME > > prints this: > > NUMBER FILENAME Removing the filename is easy enough: wc -l < FILENAME paul ___ Bug-coreut