01-20-2017
Unless the output I showed is wrong somehow, the command I just showed you works, no?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello Guys,
I am a newbie to unix. I am having a requirement. Please help me for finding a solution for this,
I am having a file as mentioned below:
$ cat shank
ackca
acackac akcajc akcjkcja akcj
ckcklc
I want to delete all the white spaces in this file,
I tried... (2 Replies)
Discussion started by: mraghunandanan
2 Replies
2. Shell Programming and Scripting
'String' file contains the following contents,
D11, D31, D92, D29, D24,
using ksh, I want to remove all white spaces between characters no matter how long the string is.
Would you please give me some help? (1 Reply)
Discussion started by: yoonius
1 Replies
3. Solaris
what my code is doing, it is executing a sql file and the resullset of the query is getting stored in the text file in a fixed format. for that fixed format i have used the following code::
Code:
awk -F":"... (2 Replies)
Discussion started by: priyanka3006
2 Replies
4. Shell Programming and Scripting
Hello All,
I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out.
My file is like this (<b> means one blank space, <t> means one tab space)-
$ cat file
NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Discussion started by: NARESH1302
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a file that contains whitespaces with spaces and spaces and tabs on each line and am wanting to remove the whitespaces. My version of sed is one that does not recognize \t etc.
The sed and awk one-liners below that I found via Google both does not work.
So my next best... (3 Replies)
Discussion started by: newbie_01
3 Replies
6. Post Here to Contact Site Administrators and Moderators
Hi ,
I want a tcl script to search a string ignoring whitespaces in a .log file . It should correctly match . The string are as follows
"Output-Maps 1 1 0 0 0" 1
and
Active Intermediate-Maps 0 0 0 ... (1 Reply)
Discussion started by: kulua
1 Replies
7. UNIX for Advanced & Expert Users
I'm trying to remove duplicate data from an input file with unsorted data which is of size >50GB and write the unique records to a new file.
I'm trying and already tried out a variety of options posted in similar threads/forums. But no luck so far..
Any suggestions please ?
Thanks !! (9 Replies)
Discussion started by: Kannan K
9 Replies
8. Shell Programming and Scripting
I have to export data from table into flat file with | delimited. In the ksh file, I am adding below to do this activity.
$DBSTRING contains the sqlplus command and $SQL_STRING contains the SQL query. File is created properly with the data as per SQL command. I am getting white spaces in the... (1 Reply)
Discussion started by: mgpatil31
1 Replies
9. Shell Programming and Scripting
Hello All ,
1. I am trying to do a task where I need to remove Blank spaces from my file , I am usingawk '{$1=$1}{print}' file>file1Input :-
;05/12/1990 ;31/03/2014 ;
Output:-
;05/12/1990 ;31/03/2014 ;This command is not removing all spaces from... (6 Replies)
Discussion started by: himanshu sood
6 Replies
10. Shell Programming and Scripting
I need to list and delete all files in current older which are olderthan 7 days. But my file names have white spaces. Before deleting I want to list all the files, so that I can verify.find . -type f -mtime +7 | xargs ls -l {}
But the ls command is the working on the files which have white... (16 Replies)
Discussion started by: karumudi7
16 Replies
LEARN ABOUT DEBIAN
format::human::bytes
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)