10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
awk '/^>/{id=$0;next}length>=7 { print id, "\n"$0}' Test.txt
Can I use substr to achieve the same task?
Thanks! (8 Replies)
Discussion started by: Xterra
8 Replies
2. Shell Programming and Scripting
Hi,
- In a file test.wmi
Col1 | firstName | lastName
4003 | toto_titi_CT- | otot_itit
- I want to have only ( colones $7,$13 and $15) with code 4003 and 4002. for colone $13 I want to have the whole name untill _CT- or _GC-
1- I used the command egrep with awk
#egrep -i... (2 Replies)
Discussion started by: georg2014
2 Replies
3. Shell Programming and Scripting
I have a command like this:
listdb ID923 -l |gawk '{if (substr($0,37,1)==1 && NR == 3)print "YES" else if (substr ($0,37,1)==0 && NR == 3) print "NO"}'
This syntax doesn't work. But I was able to get this to work:
listdb ID923 -l |gawk '{if (substr($0,37,1)==1 && NR == 3)print "YES"}'
... (4 Replies)
Discussion started by: newbie2010
4 Replies
4. Shell Programming and Scripting
HI I am using awk and substr function to list out the directory names in the present working directory .
I am using below code
ls -l | awk '{ if ((substr($1,1,1)) -eq d) {print $9 }}'
But the problem is i am getting all the files and directories listed where as the requirement i wrote... (7 Replies)
Discussion started by: prabhu_kumar
7 Replies
5. UNIX for Dummies Questions & Answers
can anybody explain this code?
thanks in advance..:) (6 Replies)
Discussion started by: janani_kalyan
6 Replies
6. UNIX for Dummies Questions & Answers
Hi, i'm a newbie and i don't know unix...
I'm a dba oracle.
I need to cat the content of a file like this:
> ps -eaf|grep pmon
oracle 221422 1 0 Sep 17 - 7:20 ora_pmon_ORCL
oracle 405626 1 0 Sep 17 - 8:39 ora_pmon_ORCL1
oracle 491534 1 0 ... (3 Replies)
Discussion started by: davyp74
3 Replies
7. Shell Programming and Scripting
Hi,
I have a long string like,
aabab|bcbcbcbbc|defgh|paswd123 dedededede|efef|ghijklmn|paswd234 ghghghghgh|ijijii|klllkkk|paswd345 lmlmlmmm|nononononn|opopopopp|paswd456
This string is devided into one space between substrings. This substrings are,
aabab|bcbcbcbbc|defgh|paswd123... (6 Replies)
Discussion started by: syamkp
6 Replies
8. UNIX for Dummies Questions & Answers
i have a variable 200612
the last two digits of this variable should be between 1 and 12, it should not be greater than 12 or less than 1 (for ex: 00 or 13,14,15 is not accepted)
how do i check for this conditions in a unix shell script.
thanks
Ram (3 Replies)
Discussion started by: ramky79
3 Replies
9. UNIX for Dummies Questions & Answers
Hi,
My input file is
41;2;xxxx;yyyyy....
41;2;xxxx;yyyyy....
41;2;xxxx;yyyyy....
..
..
I need to change the second field value from 2 to 1. i.e.,
41;1;xxxx;yyyyy....
41;1;xxxx;yyyyy....
41;1;xxxx;yyyyy....
..
..
Thanks in advance. (9 Replies)
Discussion started by: deepakwins
9 Replies
10. Shell Programming and Scripting
What is the more efficient way to do this (awk only and default FS) ?
$ echo "jefe@alm"|awk '{pos = index($0, "@");printf ("USER: %s\n",substr ($0,1,pos-1))}'
USER: jefe
Thx in advance (2 Replies)
Discussion started by: Klashxx
2 Replies