Sponsored Content
Full Discussion: Text analysis
Top Forums UNIX for Dummies Questions & Answers Text analysis Post 302508951 by John0101 on Tuesday 29th of March 2011 12:54:08 PM
Old 03-29-2011
Text analysis

Hey Guys,

Does anyone know how to count the separate amount of words in a text file?
e.g
the 5
and 20
Furthermore does anyone know how to convert whole numbers in decimals?

Thanks
 

8 More Discussions You Might Find Interesting

1. Solaris

Catalina Analysis

How can I make analysis for catalina.out (2 Replies)
Discussion started by: Burhan
2 Replies

2. Shell Programming and Scripting

AWK script: decrypt text uses frequency analysis

Ez all! I have a question how to decrypt text uses letter frequency analysis. I have code which count the letters, but what i need to do after that. Can anybody help me to write a code. VERY NEEDED! My code now: #!/usr/bin/awk -f BEGIN { FS="" } { for (i=1; i <= NF; i++) { if ($i... (4 Replies)
Discussion started by: SerJel
4 Replies

3. Programming

Regarding stack analysis

I would like to know how I could do the following : void func(){ int a = 100; b=0; int c = a/b; } void sig_handler (int sig,siginfo_t *info,void *context){ //signal handling function //here I want to access the variables of func() } int main(){ struct sigaction *act =... (7 Replies)
Discussion started by: vpraveen84
7 Replies

4. Shell Programming and Scripting

text file analysis

Hello, I have a text file containin 4 lines which are repeated along the file, ie the file looks like this: 16:20:12.060769 blablabla 40 16:20:12.093199 blablabla 640 16:20:12.209003 blablabla 640 16:20:12.273179 blablabla 216 16:20:27.217444 blablabla 40 16:20:27.235410 blablabla 640... (2 Replies)
Discussion started by: Celine19
2 Replies

5. Shell Programming and Scripting

Metacharacters analysis

:confused:Hi , Can someone please advise what is the meaning of metacharacters in below code? a_PROCESS=${0##*/} a_DPFX=${a_PROCESS%.*} a_LPFX="a_DPFX : $$ : " a_UPFX="Usage: $a_PROCESS" Regards, gehlnar (3 Replies)
Discussion started by: gehlnar
3 Replies

6. Shell Programming and Scripting

Analysis of a script

what does this line in a script mean?? I have tried to give it at the command prompt and here is what it returns ksh: /db2home/db2dap1/sqllib/db2profile: not found. . /db2home/db2dap1/sqllib/db2profile i have tried the same thing for my home directory too and the result is the same .... (5 Replies)
Discussion started by: ramky79
5 Replies

7. UNIX for Dummies Questions & Answers

Help with text analysis - UNIX

Hey Guys I recently posted yesterday about trying to count the amount of separate words that exists in a text file e.g. walle.txt. i want the output to give to give me a list of words with a number next indicating how many times its came up in the file e.g: cat 20 the 11 if 40 I'm... (0 Replies)
Discussion started by: John0101
0 Replies

8. Infrastructure Monitoring

Nmon Analysis

Dear All, I am an performance tester. Now i am working in project where we are using linux 2.6.32. Now I got an oppurtunity to learn the monitoring the server. As part of this task i need to do analysis of the Nmon report. I was completely blank in this. So please suggest me how to start... (0 Replies)
Discussion started by: iamsengu
0 Replies
Format::Human::Bytes(3pm)				User Contributed Perl Documentation				 Format::Human::Bytes(3pm)

NAME
Format::Human::Bytes - Format a bytecount and make it human readable VERSION
Version 0.05 SYNOPSIS
Ever showed 12345678 bytes to the user instead of just saying 11MB? This module returns you a printable string which is more readable by humans than a simple bytecount. use Format::Human::Bytes; $readable = Format::Human::Bytes::base2($bytecount[,$decimals]); $readable = Format::Human::Bytes::base10($bytecount[,$decimals]); $readable = Format::Human::Bytes->base2($bytecount[,$decimals]); $readable = Format::Human::Bytes->base10($bytecount[,$decimals]); my $fhb = Format::Human::Bytes->new(); $readable = $fhb->base2($bytecount[,$decimals]); $readable = $fhb->base10($bytecount[,$decimals]); All functions do "intelligent" switching to the next unit, for example: 1000 => 1000B [...] 8000 => 8000B 9000 => 9kB The difference between 1000 bytes and 1500 bytes is usually bigger (for example because of a slow link) than between 95kB and 95,5kB. The same applies to 8000kB vs. 9 MB and for the other units. Depending on your usage, you may want to specify how many decimals should be shown (defaults to no decimals). FUNCTIONS
/ METHODS new my $fhb = Format::Human::Bytes->new(); Creates and returns a Format::Human::Bytes - object. base2 Callable as a function: $readable = Format::Human::Bytes::base2($bytecount[,$decimals]); Callable as a class method: $readable = Format::Human::Bytes->base2($bytecount[,$decimals]); Callable as a object method: $readable = $fhb->base2($bytecount[,$decimals]); Returns the correct readable form of the given bytecount. Correct in this case means that 1kB are 1024 Bytes which is how computers see the world. If you specify a decimal parameter, the result number will have the number of decimal numbers you specified. base10 Callable as a function: $readable = Format::Human::Bytes::base10($bytecount[,$decimals]); Callable as a class method: $readable = Format::Human::Bytes->base10($bytecount[,$decimals]); Callable as a object method: $readable = $fhb->base10($bytecount[,$decimals]); Returns the incorrect readable form of the given bytecount. Incorrect in this case means that 1kB is 1000 Bytes and 1 MB is 1000000 bytes which is how some (many) people see the world, but it's wrong for computers. If you specify a decimal parameter, the result number will have the number of decimal numbers you specified. AUTHOR
Sebastian Willing, "<sewi at cpan.org>" BUGS
Please report any bugs or feature requests to "bug-format-human-bytes at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Format-Human-Bytes>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Format::Human::Bytes You can also look for information at: o RT: CPAN's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Format-Human-Bytes> o AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Format-Human-Bytes> o CPAN Ratings <http://cpanratings.perl.org/d/Format-Human-Bytes> o Search CPAN <http://search.cpan.org/dist/Format-Human-Bytes/> HISTORY
The functions are in use since late 2003 or early 2004 but I didn't pack them for CPAN before 2009. LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself. perl v5.10.1 2010-04-08 Format::Human::Bytes(3pm)
All times are GMT -4. The time now is 03:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy