Sponsored Content
Top Forums Shell Programming and Scripting Append data by looking up 2 tables for multiple files Post 302938221 by vgersh99 on Friday 13th of March 2015 09:32:37 AM
Old 03-13-2015
Hmmm... this is a bit confusing to parse this explanation.
Could you try it one more time with just ONE example and a desired output, pls.
I'm failing to see what keys you're using to find a match between 2 files...
This User Gave Thanks to vgersh99 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

2. Shell Programming and Scripting

Reading data from multiple tables from Oracle DB

Hi , I want to read the data from 9 tables in oracle DB into 9 different files in the same connection instance (session). I am able to get data from one table to one file with below code : X=`sqlplus -s user/pwd@DB <<eof select col1 from table1; EXIT; eof` echo $X>myfile Can anyone... (2 Replies)
Discussion started by: net
2 Replies

3. Shell Programming and Scripting

Shell script to identify the number of files and to append data

Hi I am having a question where I have to 1) Identify the number of files in a directory with a specific format and if the count is >1 we need to concatenate those two files into one file and remember that in the second file the header should not be copied. it should be form first file.... (4 Replies)
Discussion started by: pradkumar
4 Replies

4. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

5. Shell Programming and Scripting

Read multiple files, parse data and append to a file

Hi..Can anyone suggest a simple way of achieving this. I have several files which ends with extension .vcf . I will give example with two files In the below files, we are interested in File 1: 38 107 C 3 T 6 C/T 38 241 C 4 T 5 C/T 38 247 T 4 C 5 T/C 38 259 T 3 C 6 T/C... (8 Replies)
Discussion started by: empyrean
8 Replies

6. Shell Programming and Scripting

Multiple files to load into different tables,

multiple files to load into different tables, I have a script show below, but this script loads data from txt file into a table, but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder , can we load these files in diff tables (table 1, table2... (0 Replies)
Discussion started by: nani1984
0 Replies

7. Shell Programming and Scripting

Multiple files to load into different tables

multiple files to load into different tables, I have a script show below, but this script loads data from txt file into a table, but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder , can we load these files in diff tables (table 1, table2... (1 Reply)
Discussion started by: nani1984
1 Replies

8. UNIX for Beginners Questions & Answers

Using bash script : How to Import data from a dsv file into multiple tables in mysql

HI I have a dsv file that looks like: <<BOF>> record_number|id_number|first name|last name|msisdn|network|points|card number|gender 312|9101011234011|Test Junior|Smith|071 123 4321|MTN|73|1241551413214444|M 313|9012023213011|Bob|Smith|27743334321|Vodacom|3|1231233232323244|M... (4 Replies)
Discussion started by: tera
4 Replies

9. Programming

Python script to run multiple command and append data in output csv file

Experts, I am writing a script and able to write only small piece of code and not able to collect logic to complete this task. In input file have to look for name like like this (BGL_HSR_901_1AG_A_CR9KTR10) before sh iss neors. Record this (BGL_HSR_901_1AG_A_CR9KTR10) in csv file Now have to... (0 Replies)
Discussion started by: as7951
0 Replies

10. UNIX for Beginners Questions & Answers

Export Oracle multiple tables to multiple csv files using UNIX shell scripting

Hello All, just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table. Can you please suggest why? or any better idea? export FILE="/abc/autom/file/geo_JOB.csv" Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies
XYZ2GRD(l)																XYZ2GRD(l)

NAME
xyz2grd - Converting an ASCII or binary table to grd file format SYNOPSIS
xyz2grd xyzfile -Ggrdfile -Ix_inc[m|c][/y_inc[m|c]] -Rwest/east/south/north[r] [ -A[n|z] ] [ -Dxunit/yunit/zunit/scale/offset/title/remark ] [ -F ] [ -H[nrec] ] [ -L ] [ -Nnodata ] [ -S[zfile] ] [ -V ] [ -Z[flags] ] [ -: ] [ -bi[s][n] ] DESCRIPTION
xyz2grd reads a z or xyz table and creates a binary grdfile. xyz2grd will report if some of the nodes are not filled in with data. Such unconstrained nodes are set to a value specified by the user [Default is NaN]. Nodes with more than one value will be set to the average value. As an option (using -Z), a 1-column z-table may be read assuming all nodes are present (z-tables can be in organized in a number of formats, see -Z below.) [xy]zfile ASCII [or binary] file holding z or (x,y,z) values. xyz triplets do not have to be sorted (for binary triplets, see -b). 1-column z tables must be sorted and the -Z must be set). -G grdfile is the name of the binary output grdfile. -I x_inc [and optionally y_inc] is the grid spacing. Append m to indicate minutes or c to indicate seconds. -R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. OPTIONS
-A Add up multiple values that belong to the same node (same as -Az). Append n to simply count the number of data points that were assigned to each node. [Default (no -A option) will calculate mean value]. Ignored if -Z is given. -D Give values for xunit, yunit, zunit, scale, offset, title, and remark. To leave some of these values untouched, specify = as the value. -F Force pixel registration [Default is grid registration]. -H Input file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults file. If used, GMT default is 1 header record. Not used with binary data. -L Indicates that the x column contains longitudes, which may differ from the regions in -R by [multiples of] 360 degrees [Default assumes no periodicity]. -N No data. Set nodes with no input xyz triplet to this value [Default is NaN]. For z-tables, this option is used to replace z-values that equal nodata with NaN. -S Swap the byte-order of the input only. No grid file is produced. You must also supply the -Z option. The output is written to zfile (or stdout if not supplied). -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. -Z Read a 1-column ASCII [or binary] table. This assumes that all the nodes are present and sorted according to specified ordering con- vention contained in flags. If incoming data represents rows, make flags start with T(op) if first row is y = ymax or B(ottom) if first row is y = ymin. Then, append L or R to indicate that first element is at left or right end of row. Likewise for column for- mats: start with L or R to position first column, and then append T or B to position first element in a row. For gridline regis- tered grids: If data are periodic in x but the incoming data do not contain the (redundant) column at x = xmax, append x. For data periodic in y without redundant row at y = ymax, append y. Append sn to skip the first n number of bytes (probably a header). If the byte-order needs to be swapped, append w. Select one of several data types (all binary except a): a ASCII representation c signed 1-byte character u unsigned 1-byte character h short 2-byte integer i 4-byte integer l long (4- or 8-byte) integer f 4-byte floating point single precision d 8-byte floating point double precision Default format is scanline orientation of ASCII numbers: -ZTLa. Note that -Z only applies to 1-column input. -: Toggles between (longitude,latitude) and (latitude,longitude) input/output. [Default is (longitude,latitude)]. Applies to geo- graphic coordinates only. -bi Selects binary input. Append s for single precision [Default is double]. Append n for the number of columns in the binary file(s). [Default is 3 input columns]. This option only applies to xyz input files; see -Z for z tables. EXAMPLES
To create a grdfile from the ASCII data in hawaii_grv.xyz, try xyz2grd hawaii_grv.xyz -Ddegree/degree/mGal/1/0/"Hawaiian Gravity"/"GRS-80 Ellipsoid used" -Ghawaii_grv_new.grd -R198/208/18/25 -I5m -V To create a grdfile from the raw binary (3-column, single-precision) scanline-oriented data raw.b, try xyz2grd raw.b -Dm/m/m/1/0/=/= -Graw.grd -R0/100/0/100 -I1 -V -Z -b3 To make a grdfile from the raw binary USGS DEM (short integer) scanline-oriented data topo30. on the NGDC global relief Data CD-ROM, with values of -9999 indicate missing data, one must on some machine reverse the byte-order. On such machines (like Sun), try xyz2grd topo30. -Dm/m/m/1/0/=/= -Gustopo.grd -R234/294/24/50 -I30c -N-9999 -V -ZTLhw Say you have received a binary file with 4-byte floating points that were written on a machine of different byte-order than yours. You can swap the byte-order with xyz2grd floats.bin -Snew_floats.bin -V -Zf SEE ALSO
gmt(1gmt), grd2xyz(1gmt), grdedit(1gmt) 1 Jan 2004 XYZ2GRD(l)
All times are GMT -4. The time now is 05:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy