05-27-2014
How to grep the words with space between?
see I have a text like:
27-MAY 14:00 4 aaa 5.30 0.01
27-MAY 14:00 3 aaa 0.85 0.00
27-MAY 14:00 2 aaa 1.09 0.00
27-MAY 14:00 5 aaa 0.03 0.00
27-MAY 14:00 1 aaa 0.00 0.00
27-MAY 14:15 2 aaa 99.11 0.28
27-MAY 14:15 4 aaa 1.06 0.00
27-MAY 14:15 3 aaa 0.55 0.00
27-MAY 14:15 1 aaa 0.00 0.00
27-MAY 14:15 5 aaa 0.01 0.00
27-MAY 14:30 2 aaa 798.64 10.57 ***
27-MAY 14:30 4 aaa 1.48 0.00
27-MAY 14:30 3 aaa 0.16 0.00
27-MAY 14:30 5 aaa 0.03 0.00
27-MAY 14:30 1 aaa 0.00 0.00
I would like the output to be, only the 4columns with 4:
27-MAY 14:00 4 aaa 5.30 0.01
27-MAY 14:15 4 aaa 1.06 0.00
27-MAY 14:30 4 aaa 1.48 0.00
please help, thanks
---------- Post updated at 05:04 PM ---------- Previous update was at 05:01 PM ----------
figured it out
cat text| awk '$3 == "4"'
This User Gave Thanks to netbanker For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a .txt file which contains several lines of text. I need to write a script program using grep or any other unix tool so as to detect part of the text (words) between / / that begin with the symbol ~.
For example if somewhere in the text appears a webpage address like... (8 Replies)
Discussion started by: chrisxgr
8 Replies
2. UNIX for Dummies Questions & Answers
I have been trying to find files containing the words AAA, BBB and CCC.
I tried:
grep AAA `grep BBB files*` grep CCC files*
but is does not work
I tried several ways
this is an easy one but I am a dummy, Does anyone can help me?
Thanks
:( (12 Replies)
Discussion started by: murbina
12 Replies
3. Shell Programming and Scripting
Hi,
I need to insert space between words on my output in UNIX other than the single space given by the space bar on my keyboard, e.g
when are you going. (There should be 4 spaces between each of these words)
rather than
when are you going
Can anyone help me with... (3 Replies)
Discussion started by: divroro12
3 Replies
4. Shell Programming and Scripting
My file looks like:
asd absjdd
sdff vczxs
wedssx c
dasx ccc
I need to keep
asd
sdff
wedssx
dasx
How do I do that experts?:wall::wall: (1 Reply)
Discussion started by: hakermania
1 Replies
5. Shell Programming and Scripting
Hi
Please can you help me on this:
How to grep for multiple words in a file, BUT for every word found output it to a new line.
regards
FR (8 Replies)
Discussion started by: fretagi
8 Replies
6. UNIX for Dummies Questions & Answers
How do you negate a literal hyphen/dash in a regex? If it's the first character inside the brackets, then it is read literally.
But if you stick a caret to the left of it, to negate it, then it seems it is no longer read literally. Or whatever, it doesn't work.
Nor does escaping it seem to... (3 Replies)
Discussion started by: sudon't
3 Replies
7. Shell Programming and Scripting
Queue on node in domain
description :
type : local
max message len : 104857600
max queue depth : 5000
queue depth max event : enabled
persistent msgs : yes
backout threshold : 0
msg delivery seq :... (4 Replies)
Discussion started by: Daniel Gate
4 Replies
8. Shell Programming and Scripting
Hi,
I need your help for below with shell scripting or perl
I/P
key, Sentence
customer1, I am David
customer2, I am Taylor
O/P
Key, Words
Customer1,I
Customer1,am
Customer1,David
Customer2,I
Customer2,am
Customer2,Taylor (4 Replies)
Discussion started by: monishathampi
4 Replies
9. UNIX for Dummies Questions & Answers
Hi!
I'm trying to figure out how to find words with X number of doubles, only. I'm searching a dictionary, (one word per line). For instance, if you want to find words containing only one pair of double letters, you could do something like this:
egrep '(.)\1' wordlist.txt |egrep -v '(.)\1.*(.)\2'... (3 Replies)
Discussion started by: sudon't
3 Replies
10. Shell Programming and Scripting
Dear all,
I have gone through all the search and replace requests but none of them meet my particular need. I have a huge file in which all Unicode characters are stored as Names. A sample is given below. I want to replace strings in that file with a mapper from another file termed as master.dic. ... (4 Replies)
Discussion started by: gimley
4 Replies
GROHTML(1) General Commands Manual GROHTML(1)
NAME
grohtml - html driver for groff
SYNOPSIS
grohtml [ -vhlrn ] [ -Ddir ] [ -Fdir ] [ -iresolution ] [ -Iimage-stem ] [ -oimage-vertical-offset ] [ -aaa-text-bits ]
[ -aaa-graphic-bits ] [ files... ]
DESCRIPTION
The grohtml front end (which consists of a preprocessor, pre-grohtml, and a device driver, post-grohtml) translates the output of GNU troff
to html. Users should always invoke grohtml via the groff command with a -Thtml option. If no files are given, grohtml will read the
standard input. A filename of - will also cause grohtml to read the standard input. Html output is written to the standard output. When
grohtml is run by groff options can be passed to grohtml using groff's -P option.
OPTIONS
-aaa-text-bits
Number of bits of antialiasing information to be used by text when generating png images. The default is 4 but legal values are 0,
1, 2, and 4. Note your version of gs needs to support the -dTextAlphaBits and -dGraphicAlphaBits options in order to exploit
antialiasing. A value of 0 stops grohtml from issuing antialiasing commands to gs.
-gaa-graphic-bits
Number of bits of antialiasing information to be used by graphics when generating png images. The default is 4 but legal values are
0, 1, 2, and 4. Note your version of gs needs to support the -dTextAlphaBits and -dGraphicAlphaBits options in order to exploit
antialiasing. A value of 0 stops grohtml from issuing antialiasing commands to gs.
-b Initialize the background color to white.
-h Generates section and number headings by using <B>...</B> and increasing the font size, rather than using the <Hn>...</Hn> tags.
-l Turns off the production of automatic section links at the top of the document.
-r Turns off the automatic header and footer line (html rule).
-n Generate simple heading anchors whenever a section/number heading is found. Without the option the anchor value is the textual
heading. This can cause problems when a heading contains a `?' on some browsers (netscape). This flag is automatically turned on
if a heading contains an image.
-p Display page rendering progress to stderr. grohtml only displays a page number when an image is required.
-Fdir Prepend directory dir/devname to the search path for font and device description files; name is the name of the device, usually
html.
-iresolution
Select the resolution for all images. By default this is 100 pixels per inch. Example: -i200 indicates 200 pixels per inch.
-Istem Determine the image stem name. If omitted grohtml uses grohtml-XXX (XXX is the process ID).
-overtical-offset
Specify the vertical offset of images in points.
-Ddir Inform grohtml to place all image files into directory dir.
-v Print the version number.
USAGE
There are styles called R, I, B, and BI mounted at font positions 1 to 4.
DEPENDENCIES
grohtml is dependent upon the png utilities (pnmcut, pnmcrop, pnmtopng) and GhostScript (gs). pnmtopng (version 2.37.6 or greater) and
pnmcut from the netpbm package (version 9.16 or greater) will work also. It is also dependent upon psselect from the PSUtils package.
Images are generated whenever a table, picture, equation or line is encountered.
BUGS
Grohtml has been completely redesigned and rewritten. It is still alpha code.
SEE ALSO
afmtodit(1), groff(1), troff(1), psbb(1), groff_out(5), groff_font(5), groff_char(7)
Groff Version 1.18.1 16 September 2002 GROHTML(1)