09-02-2009
grep & awk
Hi all,
I'm figuring on how to grep only specific data I want below:
Bin Total %
----- ------- -----
1 15 42.9
Bin Total %
----- ------- -----
2 15 80
Bin Total %
----- ------- -----
3 20 80
I would only want the % which is 42.9 on bin 1, to output this 42.9 into a txt file.
By using awk '{print $3}' > abc.txt it displays the entire column 3. Appreciate any help. Thanks in advance!
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can I find which version of Awk is installed? OpSystem is HPUX 11.x
I am getting an error when trying to use the keyword nextfile and I dont know why! (Well, I can only assume that I have am using a version of Awk that does not support nextfile. However, according to O'Reilly, nextfile is... (3 Replies)
Discussion started by: google
3 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I've got dozens of tar's with two files in each one,
live_access_log & live_error_log (one tar for each day, backups).
The probelm is i need to match a pattern in all of the archive_access_log files and output the line to a seperate file (All_access.log).
I.e. I need to get details... (21 Replies)
Discussion started by: tom123
21 Replies
3. Shell Programming and Scripting
Hi Guys,
I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys.
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' `
Harby. (4 Replies)
Discussion started by: hariza
4 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
Please i need to know the difference between grep, egrep & grep -i when used to serach through a file.
My platform is SunOS 5.9 & i'm using the korn shell.
Regards,
- divroro12 - (2 Replies)
Discussion started by: divroro12
2 Replies
5. Shell Programming and Scripting
Hi people,
I have a file status.txt:
Following 6 ports are totally or partially unavailable:
------------------------------------------------------------
MOD LINK PORTNAMES STAT1 STAT2 STAT3 SYN TYPE
------------------------------------------------------------
8 Pr37 ... (12 Replies)
Discussion started by: gc_sw
12 Replies
6. Shell Programming and Scripting
Hi,
I'm working with gawk (on DOS) today.
A goal is: find a string for-instance '123', cut a line in two columns and write second one. The problem is: command line works OK, awk file doesn't. But I would like to work with file because there are many strings to find.
input:
line command:
awk... (4 Replies)
Discussion started by: frajer
4 Replies
7. Shell Programming and Scripting
Hi,
TASK 1:
I have been using this code to print the information of files kept at "/castor/cern.ch/user/s/sudha/forPooja" in some text file name FILE.txt.
rfdir /castor/cern.ch/user/s/sudha/forPooja | grep data | awk '{print "rfio:///castor/cern.ch/user/s/sudha/forPooja/"$9}' > FILE.txt
... (6 Replies)
Discussion started by: nrjrasaxena
6 Replies
8. Shell Programming and Scripting
Hello people!
I would like to create one script following this stage
I have one directory with 100 files
File001
File002
...
File100
(This is the format of content of the 100 files)
2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0
then I have one... (0 Replies)
Discussion started by: Abv_mx81
0 Replies
9. Shell Programming and Scripting
Hi Guru's.
I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 :
awk '{ if ($5>80) && if ($5 != 100) print $0}
But getting error:
>bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}'
syntax error The source line is 1.
The error... (6 Replies)
Discussion started by: rveri
6 Replies
LEARN ABOUT DEBIAN
rifiuti2
RIFIUTI2(1) A MS Windows recycle bin analysis tool RIFIUTI2(1)
NAME
rifiuti2 - A MS Windows recycle bin analysis tool
SYNOPSIS
rifiuti [ -x ] [ -tnl8 ] [ -o outfile ] filename
rifiuti-vista [ -x ] [ -n8 ] [ -o outfile ] file_or_directory
DESCRIPTION
Rifiuti2 is a rewrite of rifiuti, a great tool from Foundstone folks for analyzing Windows Recycle Bin INFO2 file. Analysis of Windows
Recycle Bin is usually carried out during Windows computer forensics. Rifiuti2 can extract file deletion time, original path and size of
deleted files and whether the deleted files have been moved out from the recycle bin since they are trashed. Rifiuti2 supports the INFO2
file format found in Windows up to Windows XP and the new file format found in Vista, and the program is fully internationalized. If you
need to analyse recycle bins of Windows Vista and Windows Server 2008, you should use the rifiuti-vista command, for other Windows plat-
forms, you should use the rifiuti command.
Quoting from original Foundstone page:
Many computer crime investigations require the reconstruction of a subject's Recycle Bin. Since this analysis technique is executed
regularly, we researched the structure of the data found in the Recycle Bin repository files (INFO2 files). Rifiuti, the Italian
word meaning "trash", was developed to examine the contents of the INFO2 file in the Recycle Bin. ... Rifiuti is built to work on
multiple platforms and will execute on Windows (through Cygwin), Mac OS X, Linux, and *BSD platforms."
Since the original rifiuti (last updated 2004) is restricted to English version of Windows (fail to analyze any non-latin character), thus
this rewrite. But it does more:
* Supports Windows in any other languages besides English
* Supports Vista and 2008 (they don't use INFO2 file any more)
* Enables localization (that is, translatable)
* More rigorous error checking
* Supports output in XML format
OPTIONS
These are plain text output options:
-t --delimiter=STRING
String to use as delimiter (TAB by default)
-n --no-heading
Don't show header
-l --legacy-filename
Show legacy filename instead of unicode
-8 --always-utf8
Always show file names in UTF-8 encoding
These are general application Options:
-o --output=FILE
Write output to FILE
-x --xml
Output in XML format (-t, -n, -l, -8 options will have no effect)
--from-encoding=ENC
The assumed file name character set when no unicode file name is present in INFO2 record (mandatory if INFO2 file is created by
Win98, useless otherwise)
COPYRIGHT
Part of the work of Rifiuti2 is derived from Rifiuti, both pieces of software are licensed under the simplified BSD license.
AUTHOR
The main author of Rifiuti2 is Abel Cheung, and Anthony Wong helps in some packaging and documentation work (like this manpage). The orig-
inal author of Rifiuti is Keith J Jones.
0.5.0 2008-11-21 RIFIUTI2(1)