Sponsored Content
Top Forums Shell Programming and Scripting print entire line after if lookup Post 302323091 by dcfargo on Friday 5th of June 2009 10:56:35 AM
Old 06-05-2009
print entire line after if lookup

I hope this is a basic question.

I have a file with a bunch of strings in each line (and the string number is variable).

What I want to do is a simple if command and then print the entire line.

something like awk '{if ($3=="yes") print $1,$2,$3,...$X }' infile > outfile

Can someone tell me the syntax to do a if lookup command and print out the entire line??

Thanks so much.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk+Grep Input file needs to match a column and print the entire line

I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this). For example, i have a input file1.txt: cat inputfile1.txt 218299910417 1172051195 1172070231 1172073514 1183135117 1183135118 1183135119 1281440202 ... (3 Replies)
Discussion started by: poliver
3 Replies

2. Shell Programming and Scripting

Print the entire line if second field has value P

Friends, I have .txt file with 3 millions of rows. File1.txt ABC1|A|ABCD1|XYZ1 ABC2|P|ABCD2|XYZ2 ABC3|A|ABCD3|XYZ3 ABC4|P|ABCD4|XYZ4 If second field has value P then print the entire line. Thanks in advance for your help, Prashant (4 Replies)
Discussion started by: ppat7046
4 Replies

3. Shell Programming and Scripting

Print entire line based on value in a column

Friends, File1.txt abc|0|xyz 123|129|opq def|0|678 890|pqw|sdf How do I print the entire line where second column has value is 0? Expected Result: abc|0|xyz def|0|678 Thanks, Prashant ---------- Post updated at 02:14 PM ---------- Previous update was at 02:06 PM ---------- ... (1 Reply)
Discussion started by: ppat7046
1 Replies

4. Shell Programming and Scripting

print "*" entire line

Hi folks, I want to display the "*" character the entire line. Instead of manually giving "*" multiple times in echo/print command, i want some short cut. i remember i have came across a straight forward method to display particular character (for example "*" ) for n number of times in unix.... (6 Replies)
Discussion started by: apsprabhu
6 Replies

5. UNIX for Dummies Questions & Answers

Print entire columns into new file

Dear All, I am having trouble obtaining the 3 outfiles (as shown below) from a single input file. Could you please help?? INPUT: filename a b c 1 4 2 3 3 2 4 2 7 OUTPUT: outfile1 (a.dat) 1 (2 Replies)
Discussion started by: chen.xiao.po
2 Replies

6. Shell Programming and Scripting

Print only matched string instead of entire line

Hi, I have a file whose lines are something like Tchampionspsq^@~^@^^^A^@^@^@^A^A^Aÿð^@^@^@^@^@^@^@^@^@^@^A^@^@^@^@^?ð^@^@^@^@^@^@^@?ð^@^@^@^@^@^@pppsq^@~^@#@^@^@^@^@^@^Hw^H^@^@^@^K^@^@^@^@xp^At^@^FTtime2psq^@ ~^@^^^A^@^@^@^B^A I need to extract all words matching T*psq from the file. Thing is... (4 Replies)
Discussion started by: shekhar2010us
4 Replies

7. Shell Programming and Scripting

Print entire line only if certain fixed character matches the string

Hi All, I have a file testarun.txt contains the below lines and i want to print the lines if the character positions 7-8 matches 01. 201401011111 201401022222 201402013333 201402024444 201403015555 201403026666 201404017777 201404028888 201405019999 201405020000 I am trying the... (4 Replies)
Discussion started by: Arunprasad
4 Replies

8. Shell Programming and Scripting

How to print the entire line if the mentioned match is found?

Hello Everyone, I have a file with 5 fields in each line just like mentioned below. Also the 4th field is time elapsed(hh:mm:ss) since the process is running xyz abc status 23:00:00 idle abc def status 24:00:00 idle def gji status 27:00:02 idle fgh gty status 00:00:00 idle Here I... (8 Replies)
Discussion started by: rahul2662
8 Replies

9. Shell Programming and Scripting

Input file needs to match a column and print the entire line

I have a file with class c IP addresses that I need to match to a column and print the matching lines of another file. I started playing with grep -if file01.out file02.out but I am stuck as to how to match it to a column and print the matching lines; cat file01.out 10.150.140... (5 Replies)
Discussion started by: lewk
5 Replies

10. Shell Programming and Scripting

awk to lookup stored variable in file and print matching line

The bash bash below extracts the oldest folder from a directory and stores it in filename That result will match a line in bold in input. In the matching line there is an_xxx digit in italics that (once the leading zero is removed) will match a line in link. That is the lint to print in output.... (2 Replies)
Discussion started by: cmccabe
2 Replies
DIME(1) 						      General Commands Manual							   DIME(1)

NAME
dxf2vrml - program to convert .dxf formatted 3-D datasets to .VRML format. SYNOPSIS
dxf2vrml [infile][-ooutfile][-emaxerr][-f][-l] DESCRIPTION
This manual page documents briefly the dxf2vrml command. (default infile is stdin, default outfile is stdout) This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. Instead, it has documentation in the GNU Info format; see below. dxf2vrml is a program that... OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. infile default infile is stdin -o outfile, default outfile is stdout -e, Maximum error when tessellating curves -f, Respect the $FILLMODE header variable -vrml2, Write as vrml2. Default is vrml1 -l, Use layer color, ignore the color index -s, Set sub parameter -h, Show useage. SEE ALSO
files in: /usr/share/doc/libdime/, /usr/share/doc/libdime-dev/. The programs are documented fully by http://www.coin3d.org/lib/dime/, available via the Internet. AUTHOR
This manual page was written by A. Maitland Bottoms <bottoms@debian.org>, for the Debian GNU/Linux system (but may be used by others). January 11, 2002 DIME(1)
All times are GMT -4. The time now is 06:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy