I am working with KSH on AIX and I have 2 files generated from different sources... as seen below:
[note FILE1 is noted above by the 3 characters, FILE2 is everything after the space]
FILE1 is main main data source, created daily and changes quite frequently. FILE2 is static and requires manual update. Each record in FILE1 will match the characters before the @ symbol in FILE2. However, at times, FILE1 may have more records than FILE2 and there will be no match. Rarely, FILE1 will contain less records than FILE2
I need a way to take the value of each line in FILE1 and search for it in FILE2... if found, then I need to print the record from FILE1 with the text after the @ symbol in FILE2. If no match found, I need to print "NULL"
Example output:
I'm able to put the static file within my script in the form of a giant case statement, but that is really not a feasible approach as there are 200+ records in the file. I also think I could do this with a few nasty loops, but I'm really looking for an efficient practical approach. Thanks for any help you can give...
Last edited by Scott; 05-19-2010 at 04:35 PM..
Reason: Code tags please...
Hello,
I currently have very little experience with Shell scripting and trying to create a script for the purpose of collecting the size of a couple sizes on 4 different Hosts. The Idea is to collected the information from the files in which the script is kicked off on, store the values into... (17 Replies)
Hi,
I created a skript in ksh which generate a file with semicolon as separator, this is an example of the file a created:
example content file:
hello;AAAA;2014-08-17
hello;BBBB;2014-08-17
hello;CCCC;2014-08-17
I would need to compare the content in of the second column of this file... (3 Replies)
Dear All ,
i stuck in one problem executing xml .. i have input xml as
<COMMAND name="ARRANGEMENT.WRITE" timestamp="0" so="initial">
<SVLOBJECT>
<LONG name="CSP_PMNT_ID" val="-1"/>
<MONEY name="CSP_CEILING" amount="0.0" currency="AUD"/>
... (6 Replies)
I've been asked if I can write a "quick" little ksh script that will do the following:
java java_class_file /dir/input_file.xml /dir/output_file.xml
I'm a complete newbie with ksh so any help would be appreciated.
This is on AIX and java is found in
/usr/java5/jre/bin/java (4 Replies)
Hello there, I am posting to seek help with a KSH script,
I am making a simple calculation program where the user can enter as many numbers as they like, I am getting their input using the read command, however I am not sure how to repeat doing this and storing the input in to new variables... (7 Replies)
Dear Members,
I am using the attached script to convert a input file delimited by '|' to excel.
However, while processing the attribute change_reason, the whole content of the text under change_reason is not displayed completely in the cell in excel. It is truncated after only first few words.... (1 Reply)
Hi,
I have a ksh script where I have an awk statement to exclude a few items... but my "few items" has now grown substantially and I'm looking for a nice compact way of doing this. Maybe putting the exceptions into a file or something? Any suggestions greatly appreciated.
# Excluded items... (1 Reply)
Hi,
I need help in unziping input file through shell script.
I had written script, which checks for input file extention.
If Extension is "zip" or "gz", then I want to do unzip/uncompress that file.
Caould you please let me know that, How to unzip a file through shell script (ksh).
Thanks... (16 Replies)
First I' d like to say you guys are awesome. :)
I have a word document that I cut and paste into Textpad and it removed all the fancy formatting which is fine with me. I WinScp'd it to the box and and called it inputfile.txt.
Opened it in vi and don't see any special characters or stuff that... (2 Replies)