Sponsored Content
Top Forums Shell Programming and Scripting Creating Report file with 'vlookup' kind of structure in shell Post 302392632 by clx on Friday 5th of February 2010 03:36:44 AM
Old 02-05-2010
may not a good way:
Code:
awk -v c1="$(wc -l < f1)" -v c2="$(wc -l < f2)" -v c3="$(wc -l < f3)" 'NR==FNR{f1[$1]=$2}NR>=(c1+1) && NR<=(c1+c2){f2[$1]=$2}NR>=(c1+c2+1){print $1,f1[$1],f2[$1],$2}' f1 f2 f3

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script for a writing the directory structure to a file

Hi All, I am new user of shell scripting has come up with a problem. that I have a directory structure like : Home | |--------A | |----trunk | |-------A_0_1/ | | | |-------A_0_2/ | |--------B | ... (6 Replies)
Discussion started by: bhaskar_m
6 Replies

2. Shell Programming and Scripting

vlookup in file with string search

Dear All I had two input file mention as below. Now i want to get op form mention file as below. Kindly how i get do it. Is there any thing in unix like vlookup?. FILE 1: BSC1 RXOTRX-48-8 COM MBL RXOTRX-48-9 COM MBL FILE2: RXOTX-48-8 BHOR04C RXOTX-48-9 BHOR04C op:... (2 Replies)
Discussion started by: jaydeep_sadaria
2 Replies

3. Shell Programming and Scripting

Copy a file by creating folder structure in destination as in Souce

Hello, i am having a source directory which consist of multiple sub directories and my destination folder is a empty directory. if try to copy a file source->test->1.txt from source to destination test2 using the commaind. cp source/test/1.txt desti/ It will copy the 1.txt under desti... (1 Reply)
Discussion started by: tsaravanan
1 Replies

4. UNIX for Dummies Questions & Answers

Creating a report from csv file.

Hi Gurus, I need your help in transforming the CSV file into some what a report format. My source file looks like below Date,ProdID,TimeID,LevelID 2010-08-31,200,M,1 2010-08-31,201,Q,2 2010-08-31,202,Y,1 2010-08-31,203,M,5 Output required is ... (9 Replies)
Discussion started by: naveen.kuppili
9 Replies

5. Shell Programming and Scripting

help need while creating tree structure

Hi Experts, I have table in mysql like below: 'user` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` varchar(100) NOT NULL, `member_name` varchar(100) NOT NULL, `city` varchar(100) NOT NULL, `member_id` varchar(100) NOT NULL, `password` varchar(100) NOT... (1 Reply)
Discussion started by: naw_deepak
1 Replies

6. Shell Programming and Scripting

How we can create the master file through shell to show the tree structure of the directory?

Can we create the master file that show the whole tree structure of the directory till a particular folder? Database that contains four sub repository Sybase,sql,oracle,mysql and sql and oracle contains two subrepostories Siebel and plsql and each repositories contains three folders... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

7. Programming

Dynamically creating structure in C/C++ program

Hi, For one of the project which i am working on i need to write a cpp code such that it will create the structure dynamically instead of reading it from header file. For example we have a program which is reading a binary file according to the structure mentioned in header file. But we... (0 Replies)
Discussion started by: AmbikaValagonda
0 Replies

8. Shell Programming and Scripting

Shell Scripting Vlookup

I am developing shell script on Linux OS and I have two files.Data in each file is like : File1 : A B C E F G X Y Z File 2: A C 12 E G 22 X Z 41 I need if first and third column entries ( $1 & $3) of File1 in same row matches with first & second column... (3 Replies)
Discussion started by: suneet17
3 Replies

9. Shell Programming and Scripting

Parsing a log file and creating a report script

The log file is huge and lot of information, i would like to parse and make a report . below is the log file looks like: REPORT DATE: Mon Aug 10 04:16:17 CDT 2017 SYSTEN VER: v1.3.0.9 TERMINAL TYPE: prod SYSTEM: nb11cu51 UPTIME: 04:16AM up 182 days 57 mins min MODEL, TYPE, and SN:... (8 Replies)
Discussion started by: amir07
8 Replies

10. Shell Programming and Scripting

Vlookup using Ask from specific column shell script

Input file1 frame1,dummy,server1, 00C1C N/A RDF1+TDEV RW 51789 frame1,dummy,server1, 00C1D N/A RDF1+TDEV RW 51789 frame1,dummy,server1, 00C1E N/A RDF1+TDEV RW 51789 frame1,dummy,server1, 00C1F N/A RDF1+TDEV RW 51789 frame1,dummy,server1, 00C20 N/A RDF1+TDEV RW 51789 frame1,dummy,server1,... (10 Replies)
Discussion started by: ranjancom2000
10 Replies
xml2ag(1)							   User Commands							 xml2ag(1)

NAME
xml2ag - XML to AutoGen Definiton Converter SYNOPSIS
xml2ag [-flag [value]]... [--opt-name [[=| ]value]]...[<def-file>] This program will convert any arbitrary XML file into equivalent AutoGen definitions, and invoke AutoGen. DESCRIPTION
The template will be derived from either: * the --override-tpl command line option * a top level XML attribute named, "template" One or the other must be provided, or the program will exit with a failure message. The ``base-name'' for the output will similarly be either: * the --base-name command line option * the base name of the .xml file OPTIONS
-O file, --output=file Output file in lieu of AutoGen processing. By default, the output is handed to an AutoGen for processing. However, you may save the definitions to a file instead. -L dir, --templ-dirs=dir Template search directory list. This option may appear an unlimited number of times. Pass-through AutoGen argument -T tpl-file, --override-tpl=tpl-file Override template file. Pass-through AutoGen argument -l tpl-file, --lib-template=tpl-file Library template file. This option may appear an unlimited number of times. Pass-through AutoGen argument -b name, --base-name=name Base name for output file(s). Pass-through AutoGen argument --definitions=file Definitions input file. Pass-through AutoGen argument -S file, --load-scheme=file Scheme code file to load. Pass-through AutoGen argument -F file, --load-functions=file Load scheme function library. Pass-through AutoGen argument -s suffix, --skip-suffix=suffix Omit the file with this suffix. This option may appear an unlimited number of times. This option must not appear in combination with any of the following options: select-suffix. Pass-through AutoGen argument -o suffix, --select-suffix[=suffix] specify this output suffix. This option may appear an unlimited number of times. Pass-through AutoGen argument --source-time set mod times to latest source. Pass-through AutoGen argument -m, --no-fmemopen Do not use in-mem streams. Pass-through AutoGen argument --equate=char-list characters considered equivalent. Pass-through AutoGen argument --writable, --not-writable Allow output files to be writable. The not-writable form will disable the option. Pass-through AutoGen argument --loop-limit=lim Limit on increment loops. This option takes an integer number as its argument. The value of lim is constrained to being: exactly -1, or in the range 1 through 0x1000000 The default lim for this option is: 256 Pass-through AutoGen argument --shell=shell name or path name of shell to use. Pass-through AutoGen argument -t time-lim, --timeout=time-lim Time limit for server shell. This option takes an integer number as its argument. The value of time-lim is constrained to being: in the range 0 through 3600 Pass-through AutoGen argument --trace=level tracing level of detail. This option takes a keyword as its argument. The argument sets an enumeration value that can be tested by comparing them against the option value macro. The available keywords are: nothing debug-message server-shell templates block-macros expressions everything or their numeric equivalent. The default level for this option is: nothing Pass-through AutoGen argument --trace-out=file tracing output file or filter. Pass-through AutoGen argument --show-defs Show the definition tree. Pass-through AutoGen argument --used-defines Show the definitions used. Pass-through AutoGen argument -D value, --define=value name to add to definition list. This option may appear an unlimited number of times. Pass-through AutoGen argument -U name-pat, --undefine=name-pat definition list removal pattern. This option may appear an unlimited number of times. Pass-through AutoGen argument -M type, --make-dep[=type] emit make dependency file. This option may appear an unlimited number of times. Pass-through AutoGen argument -C, --core Leave a core dump on a failure exit. Many systems default to a zero sized core limit. If the system has the sys/resource.h header and if this option is supplied, then in the failure exit path, autogen will attempt to set the soft core limit to whatever the hard core limit is. If that does not work, then an administrator must raise the hard core size limit. -?, --help Display usage information and exit. -!, --more-help Pass the extended usage information through a pager. -v [{v|c|n}], --version[={v|c|n}] Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice. EXIT STATUS
One of the following exit values will be returned: 0 Successful program execution. 1 The command options were misconfigured. 2 An error was encountered processing the template. 3 The definitions could not be deciphered. 4 An error was encountered during the load phase. 5 Program exited due to catching a signal. If your template includes string formatting, a number argument to a "%s" formatting ele- ment will trigger a segmentation fault. Autogen will catch the seg fault signal and exit with code 5. AUTHORS
Bruce Korb COPYRIGHT
Copyright (C) 1992-2011 Bruce Korb all rights reserved. This program is released under the terms of the GNU General Public License, ver- sion 3 or later. BUGS
Please send bug reports to: autogen-users@lists.sourceforge.net NOTES
This manual page was AutoGen-erated from the xml2ag option definitions. GNU AutoGen (5.12) 10 Jul 2011 xml2ag(1)
All times are GMT -4. The time now is 07:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy