10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to update the below awk, kindly provided by @RavinderSingh13, to update each line of file1 with either Low or No Low based on matching $2 of file1 to a range in $2 and $3 of file2. If the $2 value in file1 matches the range in file2 then that line is Low, otherwise it is No Low in the... (3 Replies)
Discussion started by: cmccabe
3 Replies
2. UNIX for Dummies Questions & Answers
I want to print specific range of rows and then its columns using awk command.
lets say if a file contain 15 line then i need to print line 5 to 9.
awk '{print;for( NR>=5&&NR<=9); do; print "<tr>\n<td>"$1"</td><td>"$2"</td><td>"$3"</td>\n</tr" done}' xyz.csv
not sure what's wrong... (9 Replies)
Discussion started by: amyt1234
9 Replies
3. Shell Programming and Scripting
To match range, the command is:
awk '/BEGIN/,/END/'
but what I want is the range is printed only if there is additional pattern that matches in the range itself? maybe like this:
awk '/BEGIN/,/END/ if only in that range there is /pattern/'
Thanks (8 Replies)
Discussion started by: zorrox
8 Replies
4. Shell Programming and Scripting
I was reading about different methods of awk field ranges. Does the second method have any advantage? Its quite a bit longer so I am wondering what the advantage is.
awk '{for(i=5;i<=9;i++)printf "%s ",$i;print ""}' filename ... (2 Replies)
Discussion started by: cokedude
2 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I am having a bit of a hard time using awk. I must do something wrong, but I don't know what... Any help would be greatly appreciated!
I read a file, as follows :...
ATOM 21 C THR A 4 23.721 -26.194 1.909 1.00 32.07 C
ATOM 22 O THR A 4 ... (2 Replies)
Discussion started by: hypsis
2 Replies
6. Shell Programming and Scripting
Hi All,
I am new to awk command and I had a question in using it.
I want to filter a code file and print specific functions (that contain menu word in the function name).
for example, if the file has:
function menu1()
{
}
function f2()
{
}
function menu3()
{
}so I want... (5 Replies)
Discussion started by: ghoda2_10
5 Replies
7. Shell Programming and Scripting
I have this kind of file
ABC UUIIIIIIIIIIII ,
HJHKJKL
XYZ HHJJJJJJMMM
ABC BBOOIO,
PPLIOJK
XYZ NMJKJKK
ABC MMMM
ABC OPOPO
XYZ LLKLKLL
I need to get all data from ABC till XYZ
so output should be
UUIIIIIIIIIIII (6 Replies)
Discussion started by: dinjo_jo
6 Replies
8. Shell Programming and Scripting
Hi Gurus,
I have to fetch the records from a logs as per the time stamp . I am comfortable to use awk and sed in the script . But the logic to fetch the records as per comparison is the problem. $cat my_log.log
<Jul 30, 2010 7:01:12 AM EEST> <Error> <WebLogicServer>
<Jul 30, 2010 8:04:12 AM... (3 Replies)
Discussion started by: posix
3 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I've a file with some coloumns (separated by coma) and some lines, like so:
A,B,C,D
1,2,3,4
5,6,7,8
9,1,2,3
I want to print a range of coloumns: for example all coloumns between the coloumn with the charachter B in the first line, and the coloumn with the char D in the first... (5 Replies)
Discussion started by: pippo
5 Replies
10. Shell Programming and Scripting
if the column1 and 2 in both files has same key (for example "a" and "a1") compare each first key value(a1 of a) of input2 (for example 1-4 or 65-69 not 70-100 or 44-40 etc) with all the values in input1.
if the range of first key value in input2 is outof range in input1 values named it as out... (54 Replies)
Discussion started by: repinementer
54 Replies