mappin strings of two different file and finding the mapped string and then map other fields.
As i am new to unix so facing some problems in scripting:
here is my question:
i m having two files. 1st file say a.txt contain 3 column like
and 2nd file let say b.txt contain only one column speciality:
so i want to map b.txt file column, speciality with the a.txt file and after mapping of the strings i want to get the UMP_CODE of the respected feilds also which mapped in both column. i want to assign variables name( a = &Family Practice) so that i change the fields as it is changing in every file.
my output is like this:
So thanks for any kind of help.
Moderator's Comments:
Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.
Last edited by zaxxon; 03-16-2011 at 08:36 AM..
Reason: code tags
---------- Post updated at 11:12 AM ---------- Previous update was at 10:46 AM ----------
hey its ok i made it work by myself.....
my code is like this
but as i said you earlier i am new to UNIX so having a lot of questions in my mind,
and lot of doubts. one of them is like as in normal programming we declare variables
and later use those variables in our function and loops,in the same way i want to declare variable and can use it inside the script.
Like i want to assign my b.txt fields as variable as a= General Practice, b= Family practice
and later can use in the script. Is it possible if it is then help me on
this program how to do this by declaring variables in the above codes.
so rply as soon as possible..................
Hi,
I have a file server1.log with following lines.
00002b77 ThreadMonitor W WSVR0605W: Thread "WebContainer : 2" (00000046) has been active for 542865 milliseconds and may be hung. There is/are 3 thread(s) in total in the server that may be hung.
I want to find out how many threads are... (2 Replies)
Hi All,
Assuming i have got a file test.dat which has contains as follows:
Unix = abc def fgt jug
111 2222 3333
Linux = gggg pppp qqq
C# = ccc ffff llll
I would like to traverse through the file, get the 1st occurance of "=" and then need to get the sting... (22 Replies)
Hello All,
I have a text file, i want to search for a string in it and the string is repeated multiple times in a file i want to get the first occurence of the string in a variable.
the content of file is like:
I want to grepthe first occurance of "Configuration flow done" and store the... (7 Replies)
Hi,
We have a file (e.g. a .csv file, but could be any other format), with 2 columns: the old value and the new value. We need to modify all the files within the current directory (including subdirectories), so find and replace the contents found in the first column within the file, with the... (9 Replies)
Hi,
I have a very large file that contains a listing of all files on the system. I need to create a listing from that file of all files that start with the following format: s???_*, whereas the '?' represents characters, so the file name begins with an 's' followed by three other characters and... (4 Replies)
Hi ,
Please help me with the following problem:
I have an xml file with the following lines
<cisco:name>
<cisco:mdNm>Cisco Device 7500 A Series</cisco:mdNm>
<cisco:meNm>10.1.100.19</cisco:meNm>
<cisco:ehNm>/shelf=1</cisco:ehNm>
<cisco:subname>
<cisco:sptp>Cisco PortA... (8 Replies)
Shell script help
Here is 3 sample lines from a log file
<date> INFO <java.com.blah> abcd:ID= user login
<date> DEBUG <java.com.blah> <nlah bla> abcd:ID=123 user login
<date> INFO <java.com.blah> abcd:ID=3243 user login
I want to find unique "ID" from this log... (3 Replies)
hi all..
I dont know how to search for a string in a file.. I have tried doing.. I did google but didnt get effective answers..my code is as follows:
int search(char* filename,const char*
username,const char* passwd)
{
int flag=0;
unsigned long fsize=0;
unsigned long current=0;... (2 Replies)