I am having two lists of equal number of files,
and
Content of files from list1 is :
and content of files from list2 is:
I want to compare 1st column of list1 files with 5th column of list2 files,
if it is same && the 2nd column of list2 files are "ALA", it must print 4th column of list2 files.
I used the below code:
Output: It is printing "ALA" multiple number of times, which is wrong output.
Whereas, the command:
Which is showing single file from list 1 and single file from list2 is showing the correct output.
Can any one help in accessing this code for multiple files ????
Thanx in advance
Whereas, the second given by you works perfectly. Thank you very much for this.
Now, I want to compare each of the 20 fields in list1 files with 5th field in list2 files and print their corresponding 4th field, separated by a tab.
and so on..... for all 20 fields
Is it possible in a single code or do i need to make 20 such programmes and then merge them into one?
But, I am comparing $2 which may contain any one out of 20 different strings like ALA,VAL, etc.. and if it matches with any one of these, it must print the corresponding $4. If I am doing it for only one string (like ALA) it is showing the perfect result. If I will do it separately for all the 20 strings...and then concatenate or merge the 20 different files of a single file..it would be quite cumbersome....so i was looking for the help if I could do it in a same script.
This is the sample json I have pasted here. I want all the IP address strings to be converted into an array. For example "10.38.32.202" has to be converted to everywhere in the JSON. There are multiple IPs in a JSON I am pasting one sample object from the JSON. But the IPs already in an Array... (11 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
This is what is asked:
If the user enters ‘3’, prompt the user for two file names. Verify that the file names... (2 Replies)
hi
My script as below
#!/bin/ksh
for i in `seq 1 7`
do
a=$(awk '{print $i}' /home/rama/expenese.txt)
done
for i in `seq 1 7`
do
echo "${a}"
done
content of expense.txt is as below
5032 210179 3110 132813874 53488966 11459221 5300794
I want output as... (6 Replies)
Hi,
I have general question: i have good working Perl script with .pl extension, and now I have to migrate all to another Linux box, and I was told that I can use only shell scripting, so I'm not sure how different those two things are, will it work without any changes . Is there anything smart I... (6 Replies)
In shell Can I pass " to a program ? If not what is the work around ..?
Can I define * as a wild card charecter that will return all the values from
the files ..?
I am trying to create a tool that will return the values from a property file . This tool has to support all the wild card... (1 Reply)
I want to learn Linux/Unix shell scripting, I searched this forum but got some results for Unix Admin books and general Linux books.
Would someone recommend a good Linux Shell Scripting book?
I did order one book
A Practical Guide to Linux(R) Commands, Editors, and Shell Programming ... (4 Replies)
Please Let me know this Que and Ans please Because i applied for a H1B VISA nad i have a INTERVIEW as soon so please "Difference between Linux and Unix and also C and C++ and also about Shell Scripting about all Questions and Answers ." (3 Replies)
Anyone here knows any reasonably priced courses for independent (not corporate) users that can point me to. Already know Unix commands/vi/etc but now need scripting too. Any replies will be appreciated. (2 Replies)