02-07-2018
Quote:
Originally Posted by
rdrtx1
When changing to,
cat inputfile | awk 'F == 1 { if($0 ~ "InChI=") { print $0; F = 0 } } $0 ~ "<CompoundName>" { F = 1 } '
I get the same output running this as I do for F = 1. Do I have the braces wrong or something?
This following solutions works as far as tested,
sed -n '/<CompoundName>/!d;n;/InChI=/p' infile
awk '/<CompoundName>/ {getline TMP; if (TMP ~ /InChI=/) print TMP}' file
awk '/<CompoundName>/ {getline; if (/InChI=/) print}' file
Thanks for the help. I am surprised to not see a grep solution. I always think of grep as a way to find and print text.
LMHmedchem
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11
Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies
2. Shell Programming and Scripting
Can any one help us in finding the the last word of each line from a text file and print it.
eg:
1st --> aaa bbbb cccc dddd eeee ffff ee
2nd --> aab ered er fdf ere ww ww f
the o/p should be a below.
ee
f (1 Reply)
Discussion started by: naveen_sangam
1 Replies
3. Shell Programming and Scripting
Hi folks,
I have a text file that I need to parse, and I cant figure it out. The source is a report breaking down softwares from various companies with some basic info about them (see source snippet below). Ultimately what I want is an excel sheet with only Adobe and Microsoft software name and... (5 Replies)
Discussion started by: rowie718
5 Replies
4. Shell Programming and Scripting
Hello,
I have a 100 line code. I have given a sample of it below:
ABC*654654*1*54.54*21.2*87*1*654654654654
CCC*FS*FS*SFD*DSF
GGG*FGH*CGB*FBDFG*FGDG
ABC*654654*1*57.84*45.4*88*2*6546546545
CCC*WSF*SG*FGH*GHJ
ADA*AF*SFG*DFGH*FGH*FGTH
I need to select the line starting with "ABC" its... (6 Replies)
Discussion started by: nithins007
6 Replies
5. Emergency UNIX and Linux Support
Hello,
I have a 100 line code. I have given a sample of it below:
ABC*654654*1*54.54*21.2*87*1*654654654654
CCC*FS*FS*SFD*DSF
GGG*FGH*CGB*FBDFG*FGDG
ABC*654654*1*57.84*45.4*88*2*6546546545
CCC*WSF*SG*FGH*GHJ
ADA*AF*SFG*DFGH*FGH*FGTH
I need to select the line starting with "ABC" its... (3 Replies)
Discussion started by: nithins007
3 Replies
6. Shell Programming and Scripting
After I create printer queues in AIX, I have to append a filter file location within that printers custom file. within lets say test_queue.txt I need to find the row that starts with :699 and then I need to append on the end the string /usr/local/bin/k_portrait.sh.
Now I've gotten the sed... (2 Replies)
Discussion started by: peachclift
2 Replies
7. Shell Programming and Scripting
Hi,
I have a file like below.
1,2,3,4,5,6,7,8,9I would like to print or copied to a file based of line count in perl
If I gave a condition 1 to 3 then it should iterate over above file and print 1 to 3 and then again 1 to 3 etc.
output should be
1,2,3
4,5,6
7,8,9 (10 Replies)
Discussion started by: Anjan1
10 Replies
8. Shell Programming and Scripting
Hi All,
Seeking for your assistance to print all the specific field when the condition met.
Ex:
file1.txt
1|203|3|31243|5341|6452|623|22|00|01
3|45345|123214|6534|3423|6565|643|343|232|10
if field 1 = 1 and field 3 = 3 and field 5 = 5341 and field 6 = 6452
it will print from $1 to $10.... (2 Replies)
Discussion started by: znesotomayor
2 Replies
9. UNIX for Beginners Questions & Answers
I have a file.txt containing the following:
Query= HWI-ST863:386:C5Y8UACXX:3:2302:16454:89688 1:N:0:ACACGAAT
Length=100
Score E
Sequences producing significant alignments: (Bits) Value
... (2 Replies)
Discussion started by: tons92
2 Replies
10. Shell Programming and Scripting
In the awk below I am trying to match the value in $4 of file1 with the split value from $4 in file2. I store the value of $4 in file1 in A and the split value (using the _ for the split) in array. I then strore the value in $2 as min, the value in $3 as max, and the value in $1 as chr.
If A is... (6 Replies)
Discussion started by: cmccabe
6 Replies
LEARN ABOUT DEBIAN
gchem3d
GCHEM3D(1) gnome-chemistry-utils GCHEM3D(1)
NAME
gchem3d - a small chemical viewer application
SYNOPSIS
gchem3d [OPTION(S)...] [FILE...]
DESCRIPTION
gchem3d is a small chemical viewer application, which can show several chemical file formats.
OPTIONS
The following options are accepted:
-b COLOR, --bgcolor=COLOR
Use the given color as background color. COLOR can be one of "black" (default), "white", "#rrggbb" (don't forget to escape the "#"
character in the shell).
-d MODEL, --display3d=MODEL
Choose how molecules are displayed. MODEL can be one of "BallnStick" (default), "SpaceFill".
-?, --help
Show application help options.
--help-all, --help-*
Print all or just a group of help options. These options are not documented here. Instead see gtk-options(7) and gnome-options(7).
-v, --version
Print gchem3d version information.
SEE ALSO
gnome-options(7), gtk-options(7)
AUTHORS
Jean Brefort <jean.brefort@normalesup.org>
Program author.
Daniel Leidert <daniel.leidert@wgdd.de>
Manpage author.
COPYRIGHT
Copyright (C) 2002-2007 Jean Brefort
Copyright (C) 2004-2007 Daniel Leidert
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any
later version published by the Free Software Foundation.
gcu 0.12 $Date: 2009-03-19 10:53:47 +0100 (jeu. 19 mars 2009) $ GCHEM3D(1)