Sponsored Content
Top Forums Shell Programming and Scripting AWK: read values from file1; search for values in file2 Post 302376569 by Bubnoff on Tuesday 1st of December 2009 06:18:47 PM
Old 12-01-2009
BRILLIANT ~~

My AWK knowledge has been raised to a new level and my problem was
solved.

Thanks!!!

Bub
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk/sed search lines in file1 matching columns in file2

Hi All, as you can see I'm pretty new to this board. :D I'm struggling around with small script to search a few fields in another file. Basically I have file1 looking like this: 15:38:28 sz:10001 pr:14.16 15:38:28 sz:10002 pr:18.41 15:38:29 sz:10003 pr:19.28 15:38:30 sz:10004... (1 Reply)
Discussion started by: floripoint
1 Replies

2. Shell Programming and Scripting

Search values between ranges in File1 within File2

Hi people, I have 2 files, one with a list of non consecutive ranges (File1.txt), where each range begins with the value in column 1 and finishes with the value in column 2 in the same line, as can be seen above. 215312581156279 215312581166279 215312582342558 215312582357758... (4 Replies)
Discussion started by: cgkmal
4 Replies

3. Shell Programming and Scripting

Read each word from File1 and search each file in file2

file1: has all words to be searched. 100007 200999 299997 File2: has all file names to be searched. C:\search1.txt C:\search2.txt C:\search3.txt C:\search4.txt Outfile: should have all found lines. Logic: Read each word in file1 and search each file in the list of File2; if the... (8 Replies)
Discussion started by: clem2610
8 Replies

4. Shell Programming and Scripting

Get values from different columns from file2 when match values of file1

Hi everyone, I have file1 and file2 comma separated both. file1 is: Header1,Header2,Header3,Header4,Header5,Header6,Header7,Header8,Header9,Header10 Code7,,,,,,,,, Code5,,,,,,,,, Code3,,,,,,,,, Code9,,,,,,,,, Code2,,,,,,,,,file2... (17 Replies)
Discussion started by: cgkmal
17 Replies

5. Shell Programming and Scripting

Remove lines in file1 with values from file2

Hello, I have two data files: file1 12345 aa bbb cccc 98765 qq www uuuu 76543 pp rrr bbbbb 34567 nn ccc sssss 87654 qq ppp rrrrr file2 98765 34567 I need to remove the lines from file1 if the first field contains a value that appears in file2: output 12345 aa bbb cccc 76543 pp... (2 Replies)
Discussion started by: palex
2 Replies

6. Shell Programming and Scripting

awk read in file1, gsub in file2, print to file3

I'm trying to use awk to do the following. I have file1 with many lines, each containing 5 fields describing an individual set. I have file2 which is a template config file with variable space holders to be replaced by the values in file1. I would like to substitute each set of values in file1 with... (6 Replies)
Discussion started by: msmehaffey
6 Replies

7. Shell Programming and Scripting

awk file to read values from Db2 table replacing hard coded values

Hi, I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below... if (start_new_rec=="true"){ exclude_user="false"; user=toupper($6); match(user, "XXXXX."); if (RSTART ==2 ) { ... (9 Replies)
Discussion started by: asandy1234
9 Replies

8. Shell Programming and Scripting

awk to search field2 in file2 using range of fields file1 and using match to another field in file1

I am trying to use awk to find all the $2 values in file2 which is ~30MB and tab-delimited, that are between $2 and $3 in file1 which is ~2GB and tab-delimited. I have just found out that I need to use $1 and $2 and $3 from file1 and $1 and $2of file2 must match $1 of file1 and be in the range... (6 Replies)
Discussion started by: cmccabe
6 Replies

9. Shell Programming and Scripting

Mapping the values of ids of two columns of file1 from file2

I have of two space separated files: ==> File1 <== PT|np_496075.1 st|K92748.1 st|K89648.1 PT|np_001300561.1 PT|np_497284.1 st|K90752.1 st|K90279.1 PT|np_740775.1 PT|np_497749.1 st|K90752.1 st|K92038.1 PT|np_490856.1 PT|np_497284.1 st|K90752.1 st|K88095.1 PT|np_494764.1 ==> File 2 <==... (2 Replies)
Discussion started by: sammy777888
2 Replies

10. Shell Programming and Scripting

awk to look up values in File 2 from File 1, & printingNth field of File1 based value of File2 $2

I have two files which are the output of a multiple choice vocab test (60 separate questions) from 104 people (there are some missing responses) and the question list. I have the item list in one file (File1) Item,Stimulus,Choice1,Choice2,Choice3,Choice4,Correct... (5 Replies)
Discussion started by: samonl
5 Replies
cf-know(8)						      System Manager's Manual							cf-know(8)

NAME
cf-know - cfengine's knowledge agent SYNOPSIS
: cf-know [options] DESCRIPTION
: The knowledge management agent is capable of building and analysing a semantic knowledge network. It can configure a relational database to contain an ISO standard topic map and permit regular-expression based searching of the map. Analysis of the semantic network can be per- formed providing graphical output of the data, and cf-know can assemble and converge the reference manual for the current version of the Cfengine software. cfengine is a self-healing configuration and change management based system. You can think of cfengine as a very high level language, much higher level than Perl or shell. Asingle statement is called a promise, and compliance can result in many hundreds of filesbeing created, or the permissions of many hundreds offiles being set. The idea of cfengine is to create a one or more sets of configu- ration files which willclassify and describe the setup of every host in a network. COMMAND LINE OPTIONS
: --help, -h Print the help message --build, -b Build and store topic map in the CFDB --debug, -d Set debugging level 0,1,2,3 --verbose, -v Output verbose information about the behaviour of the agent --version, -V Output the version of the software --file, -f Specify an alternative input file than the default --manual, -m Generate reference manual from internal data --manpage, -M Generate reference manpage from internal data --stories, -z Look up stories for a given topic on the command line --syntax, -S Print a syntax summary of the optional keyword or this cfengine version --topics, -T Show all topic names in CFEngine --test, -t Generate test data --removetest, -r Remove test data --updatetest, -u Update test data AUTHOR
Mark Burgess and CFEngine AS INFORMATION
Bug reports: http://bug.cfengine.com, .PP Community help: http://forum.cfengine.com Community info: http://www.cfengine.com/pages/community Support services: http://www.cfengine.com This software is Copyright (C) 2008-2013 CFEngine AS. Maintenance Commands cf-know(8)
All times are GMT -4. The time now is 03:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy