10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to extract part of a text to two variables
text is
"PL/SQL procedure successfully completed. ERROR ----------------------------------------------------------------- Test Error Message PLUSVAR ---------- 1"
I want "Test Error Message" in one variable and "1" in another variable.... (11 Replies)
Discussion started by: vedavrath
11 Replies
2. 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
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. UNIX for Dummies Questions & Answers
can anybody explain this code?
thanks in advance..:) (6 Replies)
Discussion started by: janani_kalyan
6 Replies
5. Shell Programming and Scripting
Shell Scripting Gurus,
I am having a hard time :confused: trying to figure out what I am doing wrong in my script. Below is the script snippet. It gives an error when it tries to execute the expression.
a=`expr substr $stringZ 5 10`
#!/bin/bash
echo "Hello"
stringZ="abcABC123ABCabc"... (3 Replies)
Discussion started by: yajaykumar
3 Replies
6. Shell Programming and Scripting
I'm writing a shell script in which I need to be able to pull a portion of the file name out. I'm testing with the following code:
x="O1164885.DAT"
y=`ls -ltr *${x}|awk '{print substr($0,3)}'`
echo ${x}|awk '{print substr($0,3)}'
echo "y="$y
I can echo it to the screen just fine but I... (3 Replies)
Discussion started by: ttunell
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. Shell Programming and Scripting
Hi,
I am new stuff to learn substr() function through awk for writing the Korn shell script.
Is there a way to copy from XXXX1234.ABCDEF to XXX1234 file names without changing both data files?
I appreciate your time to response this email.
Thanks,
Steve (4 Replies)
Discussion started by: sbryant
4 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
Hi,
I'm a newbie to UNIX scripting and I'm having some trouble compiling my script. I'm using the Bourne Shell and cannot seem to use the substr function correctly. I'm trying to extract the last two digits of a year that's stored in a variable based off of a condition. I've searched the... (4 Replies)
Discussion started by: E2004
4 Replies