Sponsored Content
Top Forums Shell Programming and Scripting Differences between 2 Flat Files and process the differences Post 302438018 by guruprasadpr on Saturday 17th of July 2010 12:27:38 PM
Old 07-17-2010
Hi
You got it right except for the first part. In the array, we are not storing the entire row, only the first 4 numbers of every row since you are interested in comparing the first 4. Same holds good for x as well.

Guru.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Number of differences between 2 files

Hi, "diff" command takes two file names as arguements and gives the difference between the two. How do I get the number of differences between two files ??? (Excluding whitespaces). Don't ask me to count number of lines produced by "diff". Thanks in advance, Sharath (4 Replies)
Discussion started by: sharuvman
4 Replies

2. Solaris

Differences between jar files

I want to find the difference between two jar files sitting on a sun box. How do I do this? (3 Replies)
Discussion started by: runnerpaul
3 Replies

3. Shell Programming and Scripting

Detect differences in two files

All, I have two csv files, the format of which are exactly the same. I would like to find differences between the two files but would like to identify the difference as opposed to just printing a different line. For exmaple File 1 xxx,yyy,zzz,1,2,3 111,222,333,xxx,yyy ... (4 Replies)
Discussion started by: pxy2d1
4 Replies

4. Shell Programming and Scripting

Eliminating differences in two files

Hello, I'm having trouble to read two txt files, they have employee records line by line, I need to do the reading of a file that is old and compare it with the new base in the new file, deleting the lines in old file, then add the new file data from the old file and write to the database manager.... (5 Replies)
Discussion started by: selmar
5 Replies

5. UNIX for Dummies Questions & Answers

Finding differences between 2 text files

Hi everyone, I know that's a deep treated issue but I'm actually not able to find the solution. I have 2 plain text files with ~ 2000 rows and ~5 columns. The first column of the shortest file (f1) is fully contained by the first column of the biggest one (f2), but only that column. I want to... (6 Replies)
Discussion started by: OBAFGKM
6 Replies

6. AIX

Aix process CPU differences.

Hi, I'm trying to create a script to catch a process which is consuming high CPU which I have pretty much done but it's just finding the correct place to pull the current CPU for that process. When viewed in Topas it's consuming 99.*% cpu But if I try using ps avg or ps -eo pcpu ... (5 Replies)
Discussion started by: elmesy
5 Replies

7. Shell Programming and Scripting

Comparing two files and list the differences

Hi * I have two text files which has the file size, timestamp and the file name. I need to compare these two files and get the differences in the output format. Can anyone help me out with this. * cat file1.txt *474742 Apr 18* 2010 sample.log *135098 Apr 18* 2010 Testfile 134282 Apr 18* 2010... (7 Replies)
Discussion started by: Sendhil.Kumaran
7 Replies

8. Shell Programming and Scripting

Help comparing 2 files and sending differences

I have 2 files that need to be compared. Email the differences if something is different and don't email if nothing is different. One or both of the files could be empty. One or both could have data in them. example files backup.doc.$(date +%y%m%d) file size is 0 backup.doc.$(TZ=CST+24... (4 Replies)
Discussion started by: jabbott3
4 Replies

9. Shell Programming and Scripting

Need to compare the two files and list out differences between the two

Hi, I need to compare the two files and list out difference between the two. Please assist. Best regards, Vishal (2 Replies)
Discussion started by: Vishal_dba
2 Replies

10. Shell Programming and Scripting

How to do find differences between 2 XML Files?

Hello All, Requirement is to compare 2 XML files and see if there are any differences but from some of the providers We are receiving UTF-16 formatted XML file with no end of line as shown below. Excerpt of data file: ÿþ<^@?^@x^@m^@l^@ ^@v^@e^@r^@s^@i^@o^@n^@=^@"^@1^@.^@0^@"^@... (11 Replies)
Discussion started by: Ariean
11 Replies
INGRES_FETCH_ARRAY(3)							 1						     INGRES_FETCH_ARRAY(3)

ingres_fetch_array - Fetch a row of result into an array

SYNOPSIS
array ingres_fetch_array (resource $result, [int $result_type]) DESCRIPTION
This function is an extended version of ingres_fetch_row(3). In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys. If two or more columns of the result have the same field names, the last column will take precedence. To access the another column or col- umns of the same name, you must use the numeric index of the column or make an alias for the column. For example: <?php $result = ingres_query($link, "select ap_place as city, ap_ccode as country from airport where ap_iatacode = 'VLL'"); $result = ingres_fetch_array($result); $foo = $result["city"]; $bar = $result["country"]; ?> With regard to speed, the function is identical to ingres_fetch_object(3), and almost as quick as ingres_fetch_row(3) (the difference is insignificant). By default, arrays created by ingres_fetch_array(3) start from position 1 and not 0 as with other DBMS extensions. The starting position can be adjusted to 0 using the configuration parameter ingres.array_index_start. Note Related Configurations See also the ingres.array_index_start, ingres.fetch_buffer_size and ingres.utf8 directives in Runtime Configuration. PARAMETERS
o $result - The query result identifier o $result_type - The result type. This $result_type can be INGRES_NUM for enumerated array, INGRES_ASSOC for associative array, or INGRES_BOTH (default). RETURN VALUES
Returns an array that corresponds to the fetched row, or FALSE if there are no more rows EXAMPLES
Example #1 Fetch a row of result into an array <?php $link = ingres_connect($database, $user, $password); $result = ingres_query($link,"select * from table"); while ($row = ingres_fetch_array($result)) { echo $row["user_id"]; // using associative array echo $row["fullname"]; echo $row[1]; // using enumerated array echo $row[2]; } ?> SEE ALSO
ingres_query(3), ingres_num_fields(3), ingres_field_name(3), ingres_fetch_assoc(3), ingres_fetch_object(3), ingres_fetch_row(3). PHP Documentation Group INGRES_FETCH_ARRAY(3)
All times are GMT -4. The time now is 01:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy