Sponsored Content
Top Forums Shell Programming and Scripting Pick a line in file 2 basing on array in file1 Post 302857167 by RudiC on Wednesday 25th of September 2013 02:22:47 PM
Old 09-25-2013
Try
Code:
FILENAME == "ID.TXT" { VALIDID[$1]=$1}
FILENAME == "DATA.TXT" && ($5 in VALIDID)

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split a binary file into 2 basing on 2 delemiter string

Hi all, I have a binary file (orig.dat) and two special delimiter strings 'AAA' and 'BBB'. My binary file's content is as follow: <Data1.1>AAA<Data1.2>BBB <Data2.1>AAA<Data2.2>BBB ... <DataN.1>AAA<DataN.2>BBB DataX.Y might have any length, and contains any kind of special/printable... (1 Reply)
Discussion started by: Averell
1 Replies

2. Shell Programming and Scripting

cat file1 read line-per-line then grep -A 15 lines down in fileb

STEP 1 # Set variable FILE=/tmp/mainfile SEARCHFILE =/tmp/searchfile # THIS IS THE MAIN FILE. cat /tmp/mainfile Interface Ethernet0/0 "outside", is up, line protocol is up Hardware is i82546GB rev03, BW 100 Mbps Full-Duplex(Full-duplex), 100 Mbps(100 Mbps) MAC address... (6 Replies)
Discussion started by: irongeekio
6 Replies

3. Shell Programming and Scripting

Compare multiple fields in file1 to file2 and print line and next line

Hello, I have two files that I need to compare and print out the line from file2 that has the first 6 fields matching the first 6 fields in file1. Complicating this are the following restrictions 1. file1 is only a few thousand lines at most and file2 is greater than 2 million 2. I need to... (7 Replies)
Discussion started by: gillesc_mac
7 Replies

4. UNIX for Advanced & Expert Users

how do you parse 1 line at a time of file1 ie. line(n) each line into new file

File 1 <html>ta da....unique file name I want to give file=>343...</html> <html>da ta 234 </html> <html>pa da 542 </html> and so on... File 2 343 234 542 and so on, each line in File 1 one also corresponds with each line in File 2 I have tried several grep, sed, while .. read, do,... (4 Replies)
Discussion started by: web_developer
4 Replies

5. Shell Programming and Scripting

Split a single file into several others basing on the last column

Hi folks, Happy new year. I have a file 'filename' that i wd like to split basing on the contents in the last column. The 'filename' content looks like 256772744788,9,11 256772744805,9,11 256772744792,9,11 256775543055,10,12 256782625357,9,12 256772368953,10,13 256772627735,10,13... (3 Replies)
Discussion started by: jerkesler
3 Replies

6. UNIX Desktop Questions & Answers

awk to pick out more than one line

This really is a dummy question but I'm stuck and out of time... I have a large file and out of it I only want to pick out lines starting with either "Pressure" or "N". I still need these lines to be in their original order. example of text Pressure 3 N 2 N 3 bla bla bla bla Pressure 4... (3 Replies)
Discussion started by: jenjen_mt
3 Replies

7. Shell Programming and Scripting

Replacing line 'i' of file1 with line 'j' of file 2

Hi All, As mentioned in the title I have two text files and I would like to replace line number 5 of file #1 with line number 4 of file #2 e.g. file 1 wqwert 4.4464002 3 319 286 369 46.320002 56.150002 45.100002 1 1 1 0.723 (12 Replies)
Discussion started by: f_o_555
12 Replies

8. Shell Programming and Scripting

Pick a card from an array in bash

Hello, I am trying to use $RANDOM to pick cards from an array in bash. I created the script below to give me a selection everytime I run it, but the output is always like this: 2 3 4 5 6 7 8 9 10 Jack Queen King Ace of Clubs Diamonds Hearts Spades. Can you please help me? I expected it to... (2 Replies)
Discussion started by: Pouchie1
2 Replies

9. Shell Programming and Scripting

Using regex's from file1, print line and line after matches in file2

Good day, I have a list of regular expressions in file1. For each match in file2, print the containing line and the line after. file1: file2: Output: I can match a regex and print the line and line after awk '{lines = $0} /Macrosiphum_rosae/ {print lines ; print lines } ' ... (1 Reply)
Discussion started by: pathunkathunk
1 Replies

10. UNIX for Dummies Questions & Answers

Deleting file basing on the timestamp substring in the file name

Hello, I have in my backup folder, files with names convention like this : randomFileNames_13-02-2014_23h13m09+1392333189 randomFileNames_14-02-2014_02h13m09+1392343989 randomFileNames_14-02-2014_04h13m09+1392351189 etc.... Base on timestamp at end of the filename, I would to delete all the... (7 Replies)
Discussion started by: thuyetti
7 Replies
shishi_realm_for_server_dns(3)					      shishi					    shishi_realm_for_server_dns(3)

NAME
shishi_realm_for_server_dns - API function SYNOPSIS
#include <shishi.h> char * shishi_realm_for_server_dns(Shishi * handle, char * server); ARGUMENTS
Shishi * handle Shishi library handle create by shishi_init(). char * server hostname to find realm for. DESCRIPTION
Find realm for a host using DNS lookups, according to draft-ietf-krb-wg-krb-dns-locate-03.txt. Since DNS lookups may be spoofed, relying on the realm information may result in a redirection attack. In a single-realm scenario, this only achieves a denial of service, but with cross-realm trust it may redirect you to a compromised realm. For this reason, Shishi prints a warning, suggesting that the user should add the proper 'server-realm' configuration tokens instead. To illustrate the DNS information used, here is an extract from a zone file for the domain ASDF.COM: _kerberos.asdf.com. IN TXT "ASDF.COM" _kerberos.mrkserver.asdf.com. IN TXT "MARKETING.ASDF.COM" _ker- beros.salesserver.asdf.com. IN TXT "SALES.ASDF.COM" Let us suppose that in this case, a client wishes to use a service on the host foo.asdf.com. It would first query: _kerberos.foo.asdf.com. IN TXT Finding no match, it would then query: _kerberos.asdf.com. IN TXT RETURN VALUE
Returns realm for host, or NULL if not found. REPORTING BUGS
Report bugs to <bug-shishi@gnu.org>. COPYRIGHT
Copyright (C) 2002-2010 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command info shishi should give you access to the complete manual. shishi 1.0.1 shishi_realm_for_server_dns(3)
All times are GMT -4. The time now is 03:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy