Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to compare 2 files & get specific value & replace it in other file. Post 302405534 by reva on Friday 19th of March 2010 05:15:53 AM
Old 03-19-2010
for the same data above if i replace the date & time in b.dat as
Date: 2010/ 3/5 Centroid Time: 19:19: 4.8 GMT
Then the result s same ...
its not printing the result in c.dat correctly as
Code:
 PDE-W 2009 12 16  5 29 11.11  13.9100  92.9400  46.0   0  4.30   0  0.00  0.00  0.00   0  0.00  4.30   0   sss
 PDE-W 2009 12 28  2 15  4.87  30.6900  83.7700  10.0   0  4.40   0  0.00  0.00  0.00   0  0.00  4.40   0   aaa
 PDE-W 2009 12 29  9  1 55.31  24.3600  94.8100 124.0   0  0.00   0  0.00  5.70  0.00   0  0.00  5.70   0   bbb
 PDE-W 2009 12 29  9 30 13.19  39.2700  72.9700  10.0   0  4.40   0  0.00  0.00  0.00   0  0.00  4.40   0   aaa
 PDE-Q 2010  2 26  4 42 29.63  28.4100  86.7500  10.0   0  5.40   0  0.00  0.00  0.00   0  0.00  5.40   0   aaa
 PDE-Q 2010  2 27 23 21 13.42  35.9100  70.0500 104.0   0  5.70   0  0.00  5.60  0.00   0  0.00  5.70   0   aaa
 PDE-Q 2010  2 28 12 13 26.61   2.0500  98.9200  47.0   0  5.10   0  0.00  0.00  0.00   0  0.00  5.10   0   aaa
 PDE-Q 2010  3  5 19 19  4.95  34.9900  95.7900  45.0   0  4.80   0  0.00  5.80  0.00   0  0.00  4.80   0   aaa


Last edited by reva; 03-19-2010 at 06:21 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare & replace contents within a file

I have 2 files file1 1 TMQUEUE QUE1 STMW633A 100 DMADM DOMGRPSTMW633A STMW633A 100 GWADM GWTGRPSTMW633A STMW633A 100 GWADM GWTGRPSTMW633AA STMW633A 100 GWADM GWTGRPSTMW638A STMW638A 100 TMSYSEVT EVTGRPSTMW633A STMW633A 100 TMSYSEVT ... (2 Replies)
Discussion started by: kaustubh137
2 Replies

2. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

3. Shell Programming and Scripting

Compare two files A & B and accordingly modify file A

Friends, i have two huge complex files (for eg :A & B)as output , the sample contents of the files are as follows : A == ID,DATE,SUM1,SUM2,TOTAL(SUM1+2) A5066,20/04/2010,25000,50000,75000 A5049,20/04/2010,25000,60000,85000 B == ID,DATE,SUM1,SUM2,TOTAL(SUM1+2)... (2 Replies)
Discussion started by: appu2176
2 Replies

4. Shell Programming and Scripting

replace & with & xml file

Hello All I have a xml file with many sets of records like this <mytag>mydata</mytag> <tag2>data&</tag2> also same file can be like this <mytag>mydata</mytag> <tag2>data&</tag2> <tag3>data2&amp;data3</tag3> Now i can grep & and replace with &amp; for whole file but it will replace all... (4 Replies)
Discussion started by: lokaish23
4 Replies

5. Shell Programming and Scripting

Search & Replace in Multiple Files by reading a input file

Hi, I have a folder which contains multiple config.xml files and one input file, Please see the below format. Config Files format looks like :- Code: <application name="SAMPLE-ARCHIVE"> <NVPairs name="Global Variables"> <NameValuePair> ... (0 Replies)
Discussion started by: haiksuresh
0 Replies

6. Shell Programming and Scripting

Replace & sign to &amp word

Hi, I have text file abc.txt. In this file, I have the following data. Input: Mr Smith &amp Mrs Smith Mr Smith &apos Mrs Smith Mr Smith & Mrs Smith Mr Smith& Mrs Smith Mr Smith &Mrs Smith Output: Mr Smith &amp Mrs Smith Mr Smith &apos Mrs Smith Mr Smith &amp Mrs Smith Mr Smith&amp... (4 Replies)
Discussion started by: naveed
4 Replies

7. Shell Programming and Scripting

awk search/replace specific field, using variables for regexp & subsitution then overwrite file

Hello, I'm trying the solve the following problem. I have a file which I intend to use as a csv called master.csv The columns are separated by commas. I want to change the text on a specific row in either column 3,4,5 or 6 from xxx to yyy depending upon if column 1 matches a specified pattern.... (3 Replies)
Discussion started by: cyphex
3 Replies

8. Shell Programming and Scripting

Replace dashes positions 351-357 & 024-043 with 0 & replace " " if exis with 04 at position 381-382

I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Discussion started by: lancesunny
11 Replies

9. Shell Programming and Scripting

Compare File & Copy Replace if Successful

Hi All, I have written a shell script that creates a backup of my MySQL database. The script performs the following functions: Creates a Backup of the MySQL database Compresses the Backup Copies the Backup to a Remote Server Send an E-Mail displaying the size of the Backup Removes any... (6 Replies)
Discussion started by: SalientAnimal
6 Replies

10. Shell Programming and Scripting

Search & Replace in Multiple Files by reading a input file

I have a environment property file which contains: Input file: value1 = url1 value2 = url2 value3 = url3 and so on. I need to search all *.xml files under directory for value1 and replace it with url1. Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Discussion started by: Shamkamde
7 Replies
load_datafile_object(3alleg4)					  Allegro manual				     load_datafile_object(3alleg4)

NAME
load_datafile_object - Loads a specific object from a datafile. Allegro game programming library. SYNOPSIS
#include <allegro.h> DATAFILE *load_datafile_object(const char *filename, const char *objectname); DESCRIPTION
Loads a specific object from a datafile. This won't work if you strip the object names from the file, and it will be very slow if you save the file with global compression. Example: /* Load only the music from the datafile. */ music_object = load_datafile_object("datafile.dat", "MUSIC"); /* Play it and wait a moment for it. */ play_midi(music_object->dat); ... /* Destroy unneeded music. */ unload_datafile_object(music_object); RETURN VALUE
Returns a pointer to a single DATAFILE element whose `dat' member points to the object, or NULL if there was an error or there was no object with the requested name. Remember to free this DATAFILE later to avoid memory leaks, but use the correct unloading function! SEE ALSO
unload_datafile_object(3alleg4), load_datafile(3alleg4), set_color_conversion(3alleg4), find_datafile_object(3alleg4), regis- ter_datafile_object(3alleg4) Allegro version 4.4.2 load_datafile_object(3alleg4)
All times are GMT -4. The time now is 04:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy