10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to merge the below awk, which compares two files looking for a match in $2 and then prints the line if two conditions are meet.
awk
awk 'FNR==NR{A=$0;next} ($2 in A){if($10>30 && $11>49){print A}}' F113.txt F113_tvc.bed
This code was improved and provided by @RavinderSingh13,... (18 Replies)
Discussion started by: cmccabe
18 Replies
2. Shell Programming and Scripting
Hi ,
I am having a problem with my awk oneliner , which for some reason leaves the first two records
Input File
$ cat file1
A1:B1:C1:NoLimit
M1:M2:M3:Limit
A2:B2:C2,C3,C4,C5
A3:B3:C3,C4,C5,C6,C7Desired output
A1,B1,C1,NoLimit
M1,M2,M3,Limit
A2,B2,C2
,,,C3
,,,C4
,,,C5
A3,B3,C3... (5 Replies)
Discussion started by: chidori
5 Replies
3. UNIX for Dummies Questions & Answers
Hi !
It is a general question.
When an awk script looks like:
#! bin/awk
function example(i){
<body>
}
{
example(1) #the function uses input_1 and return output_a
}
{
example(2) #the function uses previous output_a as an input and returns... (15 Replies)
Discussion started by: beca123456
15 Replies
4. UNIX for Advanced & Expert Users
Hi Guys
i have set the watch command on my shell
watch=all
but this will report when i open and close a shell, is there a way so that it will ignore me user but only when i am on my machine
i can set it to
watch=notme
but that will not detect if someone su -<my... (0 Replies)
Discussion started by: ab52
0 Replies
5. Shell Programming and Scripting
Hi,
I have a bunch of records within a directory where each one has this form:
(example file1)
1 2 50 90 80 90 43512 98 0909 79869 -9 7878 33222 8787 9090 89898 7878 8989 7878 6767 89 89 78676 9898 000 7878 5656 5454 5454
and i want for all of these files to be... (3 Replies)
Discussion started by: amarn
3 Replies
6. Shell Programming and Scripting
Hi All,
I am using the awk command to replace ',' by '\t' (tabs) in a csv file. I would like to apply this to all .csv files in a directory and create .txt files with the tabs.
How would I do this in a script?
I have the following script called "csvtabs":
awk 'BEGIN {
FS... (4 Replies)
Discussion started by: ScKaSx
4 Replies
7. Shell Programming and Scripting
I got a file with contents are of the following format
...
2007-09-28 ./.passwwd1.sh.swp
2007-11-26 ./827-55.jpg
2007-09-28 ./argcheck.pl
...
I have to delete all the '-' in the "first field", ie. the date, not on the second field, which is the name of the file.
i.e.
required output
... (1 Reply)
Discussion started by: jaduks
1 Replies
8. Shell Programming and Scripting
echo "Enter a,: \c"
read answer
echo
case "$answer" in
a|A)
echo "Enter a file :\c"
read $answer
echo " Enter a string to be searched :\c"
read $answer2
if
then
echo " file doesn't exist" ... (5 Replies)
Discussion started by: props
5 Replies
9. UNIX for Dummies Questions & Answers
Hi all
Wanted to know if there is a command that gives me the bandwidth used at any point of time (in mbps). I pay for the bandwidth I have used and need to be alerted everytime I corss over a certain limit.
Regards
KS (5 Replies)
Discussion started by: skotapal
5 Replies
10. Programming
How does commnad tail implement ?
Thank you . (1 Reply)
Discussion started by: chenhao_no1
1 Replies