10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Trying to use awk to store the value of $5 in file1 in array x. That array x is then used to search $4 of file1 to find aa match (I use x to skip the header in file1). Since $4 can have multiple strings in it seperated by a , (comma), I split them and iterate througn each split looking for a match.... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
In the awk, thanks you @RavinderSingh13, for the help in below, hopefully it is close as I am trying to update the value in $12 of the tab-delimeted file2 with the matching value in $1 of the space delimeted file1. I have added comments for each line as well. Thank you :).
awk
awk '$12 ==... (10 Replies)
Discussion started by: cmccabe
10 Replies
3. Shell Programming and Scripting
In the out.txt below I am trying to use awk to update the contents of $9.. If $9 contains a + or - then $8 of out.txt is used as a key to lookup in $2 of file. When a match ( there will always be one) is found the $3 value of that file is used to update $9 of out.txt separated by a :. So the... (6 Replies)
Discussion started by: cmccabe
6 Replies
4. Shell Programming and Scripting
I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output.
$1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies
5. Shell Programming and Scripting
I am trying to use awk to match the NM_ in file with $1 of id which is tab-delimited. The NM_ will always be in the line of file that starts with > and be after the second _. When there is a match between each NM_ and id, then the value of $2 in id is substituted or used to update the NM_. Each NM_... (3 Replies)
Discussion started by: cmccabe
3 Replies
6. Shell Programming and Scripting
I am trying to use awk to match two files that are tab-delimited. When a match is found between file1 $1 and file2 $4, $4 in file2 is updated using the $2 value in file1. If no match is found then the next line is processed. Thank you :).
file1
uc001bwr.3 ADC
uc001bws.3 ADC... (4 Replies)
Discussion started by: cmccabe
4 Replies
7. Shell Programming and Scripting
If $1 in file1 matches $2 in file2. Then the value in $2 of file2 is updated to $1"."$2 of file2. The awk seems to only match the two files but not update. Thank you :).
awk
awk 'NR==FNR{A ; next} $1 in A { $2 = a }1' file1 file2
file1
name version
NM_000593 5
NM_001257406... (3 Replies)
Discussion started by: cmccabe
3 Replies
8. Shell Programming and Scripting
Hi,
I appreciate all who have been very helpful to me in providing valuable suggestions and replies.
I want to write a script to look up a file and match the contents. Let me go through the scenario. Lets say i have two files
Content file:
abc, bcd, adh|bcdf|adh|wed
bcf, cdf,... (2 Replies)
Discussion started by: forums123456
2 Replies
9. Shell Programming and Scripting
Hi,
I am having a file which contains as below
Names(aaaa
,bbbb
,cccc
,dddd)
now i want the file to be updated with new value 'eeee' as below
Names(aaaa
,bbbb
,cccc
,dddd
,eeee)
Is there a way to script this ?
Thanks, (5 Replies)
Discussion started by: drams
5 Replies
10. Shell Programming and Scripting
Hi All,
I have a data file which has two columns Location and the Count.
The file looks like this
India 1
US 0
UK 2
China 0
What I have to do is whenever I fails to login to Oracle then I have to add 1 to the count for that location.
Whenever my script fails to login to Oracle for a... (5 Replies)
Discussion started by: rajus19
5 Replies