Sponsored Content
Full Discussion: VLOOKUP utility in UNIX
Top Forums Shell Programming and Scripting VLOOKUP utility in UNIX Post 302143217 by hjoshi on Wednesday 31st of October 2007 06:40:44 AM
Old 10-31-2007
Thanks for reply. It works well for give example but not for my files probably because there are multiple mappings involved.
plz refer to file attached.

For example, for file test1 for first 3 rows (1st field "1"), it should be pick entry from test2 as "4" (because 1st entry of test1 i.e. 1 matches with 1st entry of test2 for all three cases.)

similarly for file test1 for 4th, 5th & 6th rows, the value picked up from file test2 should be "2".

plz help

Thanks a million in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Problem with tip utility in unix

Hi , I have wrote a telnet clinet application to interact with remote system . This program takes the screen shots for every interaction and send back to us. After connecting to remote machine , i want to call tip utility to interact with a device which is connected to one remote system. Now my... (0 Replies)
Discussion started by: prasadvsda
0 Replies

2. SCO

Zip utility in sco unix

how can zip a directory in sco unix and transfer it to any other system using ftp. and finally how can i unzip it regards, ajay (1 Reply)
Discussion started by: ajay234
1 Replies

3. Shell Programming and Scripting

Want to implement VLOOKUP (Excel function) in Unix

Dear All, i want to implement vookup function which is there in excel into Unix. Suppose i have 2 files. The files are given below. File1: MSC Cell SDCA Patna-1 12 Bihar Patna-2 45 Ranchi Bhopal-1 85 Raigarh Bhopal-2 ... (8 Replies)
Discussion started by: pravani1
8 Replies

4. UNIX for Dummies Questions & Answers

age utility in unix

Hi, Can anyone explain me the use of age utility and how it works? Looking forward reply... Thanks, Venkatesh. (1 Reply)
Discussion started by: venkatesht
1 Replies

5. Shell Programming and Scripting

Help require for vLookup Utility same as in EXCEL

Hi guys, can someone please help me with a vlookup utility in shell script that does the work similar to Excel. Ex: If File1.txt is 1 2 11 4 12 and File2.txt is 1 tab1 2 tab2 3 tab3 4 tab4 5 tab5 then the utility should create File3.txt with the below mentioned output: (24 Replies)
Discussion started by: viveklgupta007
24 Replies

6. Shell Programming and Scripting

awk script to perform an action similar to vlookup between two csv files in UNIX

Hi, I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files. Here are the contents of the two files: File 1: Date,ParentID,Number,Area,Volume,Dimensions 2014-01-01,ABC,247,83430.33,857.84,8110.76... (9 Replies)
Discussion started by: Prit Siv
9 Replies

7. UNIX for Beginners Questions & Answers

UNIX mail utility

Hi, I work on a Middleware application which is installed on Windows, but its file System is on HP UNIX. I am supposed to change the SMTP host address for my application. But I am not able to find the file where the old SMTP host would have been configured/hardcoded. Can anyone assist me on this... (2 Replies)
Discussion started by: jhilmil
2 Replies

8. UNIX for Beginners Questions & Answers

Vlookup on 2 files - inserting vlookup command on another command

Hello, i am trying to print group name column(etc/group) on script (etc/passwd) since group name is not listed on etc/passwd columns. Im trying to do a vlookup. but i cant figure out how i can insert the vlookup command FNR==NR inside the print out command or the output. I also tried exporting... (2 Replies)
Discussion started by: joonisio
2 Replies

9. Linux

UNIX Utility Development Conventions?

I'm slowly hacking away at a zsh script that shows some promise as a command line tool. I want to learn more about the conventions regarding command line tool development in Unix (and/or macOS), but don't really know where to look for this information. What is the correct way, or convention, to... (2 Replies)
Discussion started by: MonilGomes
2 Replies

10. UNIX for Beginners Questions & Answers

How to compare two files in UNIX using similar to vlookup?

Hi, I want to compare same column in two files, if values match then display the column or display "NA". Ex : File 1 : 123 abc xyz pqr File 2: 122 aab fdf pqr fff qqq rrr (1 Reply)
Discussion started by: hkoshekay
1 Replies
EXIF_READ_DATA(3)							 1							 EXIF_READ_DATA(3)

exif_read_data - Reads theEXIFheaders fromJPEGorTIFF

SYNOPSIS
array exif_read_data NULL (string $filename, [string $sections], [bool $arrays = false], [bool $thumbnail = false]) DESCRIPTION
exif_read_data(3) reads the EXIF headers from a JPEG or TIFF image file. This way you can read meta data generated by digital cameras. EXIF headers tend to be present in JPEG/TIFF images generated by digital cameras, but unfortunately each digital camera maker has a differ- ent idea of how to actually tag their images, so you can't always rely on a specific Exif header being present. Height and Width are computed the same way getimagesize(3) does so their values must not be part of any header returned. Also, html is a height/width text string to be used inside normal HTML. When an Exif header contains a Copyright note, this itself can contain two values. As the solution is inconsistent in the Exif 2.10 stan- dard, the COMPUTED section will return both entries Copyright.Photographer and Copyright.Editor while the IFD0 sections contains the byte array with the NULL character that splits both entries. Or just the first entry if the datatype was wrong (normal behaviour of Exif). The COMPUTED will also contain the entry Copyright which is either the original copyright string, or a comma separated list of the photo and editor copyright. The tag UserComment has the same problem as the Copyright tag. It can store two values. First the encoding used, and second the value itself. If so the IFD section only contains the encoding or a byte array. The COMPUTED section will store both in the entries UserCom- mentEncoding and UserComment. The entry UserComment is available in both cases so it should be used in preference to the value in IFD0 sec- tion. exif_read_data(3) also validates EXIF data tags according to the EXIF specification (http://exif.org/Exif2-2.PDF, page 20). Note Windows Me/XP can both wipe the Exif headers when connecting to a camera. PARAMETERS
o $filename - The name of the image file being read. This cannot be an URL. o $sections - Is a comma separated list of sections that need to be present in file to produce a result array. If none of the requested sec- tions could be found the return value is FALSE. +----------+---------------------------------------------------+ | FILE | | | | | | | FileName, FileSize, FileDateTime, SectionsFound | | | | |COMPUTED | | | | | | | html, Width, Height, IsColor, and more if avail- | | | able. Height and Width are computed the same way | | | getimagesize(3) does so their values must not be | | | part of any header returned. Also, html is a | | | height/width text string to be used inside normal | | | HTML. | | | | | ANY_TAG | | | | | | | Any information that has a Tag e.g. IFD0, EXIF, | | | ... | | | | | IFD0 | | | | | | | All tagged data of IFD0. In normal imagefiles | | | this contains image size and so forth. | | | | |THUMBNAIL | | | | | | | A file is supposed to contain a thumbnail if it | | | has a second IFD. All tagged information about | | | the embedded thumbnail is stored in this section. | | | | | COMMENT | | | | | | | Comment headers of JPEG images. | | | | | EXIF | | | | | | | The EXIF section is a sub section of IFD0. It | | | contains more detailed information about an | | | image. Most of these entries are digital camera | | | related. | | | | +----------+---------------------------------------------------+ o $arrays - Specifies whether or not each section becomes an array. The $sections COMPUTED, THUMBNAIL, and COMMENT always become arrays as they may contain values whose names conflict with other sections. o $thumbnail - When set to TRUE the thumbnail itself is read. Otherwise, only the tagged data is read. RETURN VALUES
It returns an associative array where the array indexes are the header names and the array values are the values associated with those headers. If no data can be returned, exif_read_data(3) will return FALSE. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 4.3.0 | | | | | | | Can read all embedded IFD data including arrays | | | (returned as such). Also the size of an embedded | | | thumbnail is returned in a THUMBNAIL subarray, | | | and can return thumbnails in TIFF format. Also, | | | there is no longer a maximum length for returned | | | values (not until the memory limit has been | | | reached) | | | | | 4.3.0 | | | | | | | If PHP has mbstring support, the user comment | | | can automatically change encoding. Also, if the | | | user comment uses Unicode or JIS encoding this | | | encoding will automatically be changed according | | | to the exif ini settings in php.ini | | | | | 4.3.0 | | | | | | | If the image contains any IFD0 data then COM- | | | PUTED contains the entry ByteOrderMotorola which | | | is 0 for little-endian (intel) and 1 for big- | | | endian (motorola) byte order. Also, COMPUTED and | | | UserComment no longer only contain the first | | | copyright entry if the datatype was wrong. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 exif_read_data(3) example <?php echo "test1.jpg:<br /> "; $exif = exif_read_data('tests/test1.jpg', 'IFD0'); echo $exif===false ? "No header data found.<br /> " : "Image contains headers<br /> "; $exif = exif_read_data('tests/test2.jpg', 0, true); echo "test2.jpg:<br /> "; foreach ($exif as $key => $section) { foreach ($section as $name => $val) { echo "$key.$name: $val<br /> "; } } ?> The first call fails because the image has no header information. The above example will output something similar to: test1.jpg: No header data found. test2.jpg: FILE.FileName: test2.jpg FILE.FileDateTime: 1017666176 FILE.FileSize: 1240 FILE.FileType: 2 FILE.SectionsFound: ANY_TAG, IFD0, THUMBNAIL, COMMENT COMPUTED.html: width="1" height="1" COMPUTED.Height: 1 COMPUTED.Width: 1 COMPUTED.IsColor: 1 COMPUTED.ByteOrderMotorola: 1 COMPUTED.UserComment: Exif test image. COMPUTED.UserCommentEncoding: ASCII COMPUTED.Copyright: Photo (c) M.Boerger, Edited by M.Boerger. COMPUTED.Copyright.Photographer: Photo (c) M.Boerger COMPUTED.Copyright.Editor: Edited by M.Boerger. IFD0.Copyright: Photo (c) M.Boerger IFD0.UserComment: ASCII THUMBNAIL.JPEGInterchangeFormat: 134 THUMBNAIL.JPEGInterchangeFormatLength: 523 COMMENT.0: Comment #1. COMMENT.1: Comment #2. COMMENT.2: Comment #3end THUMBNAIL.JPEGInterchangeFormat: 134 THUMBNAIL.Thumbnail.Height: 1 THUMBNAIL.Thumbnail.Height: 1 SEE ALSO
exif_thumbnail(3), getimagesize(3). PHP Documentation Group EXIF_READ_DATA(3)
All times are GMT -4. The time now is 06:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy