10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
2. Shell Programming and Scripting
Hi Team,
I am trying to get the data in below format
Jan 01 | 19:00:32 | xyz | abc | sometext | string
however I am not sure of the total number strings which can come in the record hence i cant use something like below as it can end $6 or it can go further
cat file| awk... (8 Replies)
Discussion started by: rakesh_411
8 Replies
3. Shell Programming and Scripting
Hi I am using a awk command but not getting required o/p.
input file
a.txt
2 ak
3 cb
4 de
5 gh
6 ij
awk program
BEGIN { x=0 }
{if ($1>3) {x=x+1}{print $0} }
END { print "I found " x " line have value more than 3" }
output
2 ak
3 cb
4 de
5 gh
6 ij (3 Replies)
Discussion started by: aaysa123
3 Replies
4. Shell Programming and Scripting
Hi Everyone,
I am facing a problem regarding the select from sybase, the return with the incorrect size.
For example, field is NAME(20).
After i selected from sybase, the result is nicky.
after i assign it to another declaration variable, it will be in actual name "nicky" , what i need... (10 Replies)
Discussion started by: ryanW
10 Replies
5. Shell Programming and Scripting
I have input file like this
Input file:
ABC|abc_etc_passwd
XYZ|XYZ_etc_passwd
zXY|XYZ_etc_passwd
IJK|test_etc_passwd
KLM|test_etc_passwd
i want to do following in a loop.
grep 'ABC' *abc_etc_passwd*
grep 'XYZ' *XYZ_etc_passwd*
grep 'ZXY' *ZXY_etc_passwd*
i have tried this
for i... (2 Replies)
Discussion started by: pinnacle
2 Replies
6. Shell Programming and Scripting
Hi
I would like to add lines to a file at specific locations.
eg: If I have a file containing data...
ABC
DEF
GHIJKLKMNOP
RSTUVWXYZ
and I have a requirement to insert a lines
a) "LINE_FIRST" before first line in the file
b) "LINE_X" before third line in the file
c) "LINE_LAST"... (2 Replies)
Discussion started by: tostay2003
2 Replies
7. Shell Programming and Scripting
#!/bin/bash
wget -O tmp.tmp "YouTube - Pretty Woman- Vivian's Goes Shopping!"
temp=`grep 'one&video_id=' tmp.tmp | sed "s/.*one&video_id=\(.*\)'\;.*/\1/"`
temp="http://www.youtube.com/get_video?video_id=$temp"
temp=`echo $temp|sed -n "s/!/\\!/p"`
echo " -O $filename \"$temp\""
Output:... (3 Replies)
Discussion started by: kds1398
3 Replies
8. Shell Programming and Scripting
Hi All,
I am using Unix ksh script.
I need to insert values to a table using the o/p from a slelect statement.
Can anybody Help!
My script looks like tihs.
---`sqlplus -s username/password@SID << EOF
set heading off
set feedback off
set pages 0
insert into ${TB_NAME}_D... (2 Replies)
Discussion started by: nkosaraju
2 Replies
9. Shell Programming and Scripting
Hello,
I'm having a files with variable no of lines. An example for this file is as follows
~xxx
STRT 0.0000000000 :
STOP :
~xxxxx
0.000000 557.109552 -557.109552
1511.482910 -954.373377 954.373377
in the STOP line below the 0.00000000000 I need... (8 Replies)
Discussion started by: santyshyam
8 Replies
10. Shell Programming and Scripting
In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands.
How do I write the "do nothing" statement in the following example?
Example:
if (( "$x"="1" && "$y"="a" && "$z"="happy" ))
then
do nothing
else
command
command
fi... (3 Replies)
Discussion started by: april
3 Replies