9 More Discussions You Might Find Interesting
1. Programming
Hi,
I have a file with contents like "abcd 1234" .What i need is get that integer and replace that with 0. So i used fscanf(fp,"%s %d", str, &num); This is having some problem.
There can be multiple space/tab between string and number. How to replace that number with 0 in same file? (4 Replies)
Discussion started by: explore
4 Replies
2. Shell Programming and Scripting
Hi,
I have file as below
COMMIT
# at 34572
# at 23432
COMMIT
# at 5674
# at 7856
I want to replace with as below (12 Replies)
Discussion started by: kaushik02018
12 Replies
3. Shell Programming and Scripting
Hi,
I have a set of files in a directory that I have to read and replace the first occurrence of a number with another dummy number. This is what I have so far but it does not seem to work. The files have lot of other data in each row and each data element is separated by ,@,
for file in... (13 Replies)
Discussion started by: scorpioraghu
13 Replies
4. Shell Programming and Scripting
Dear all,
I need your help with some shell scripting which I have just started. I have a file whose content look something like:
Pressure 1 1 1e5
Temperature 1 1 300
Volume 1 1 2e-20
And there are other lines too, but these are the lines i wish to play with. These files... (7 Replies)
Discussion started by: hrushi.397
7 Replies
5. Shell Programming and Scripting
Hi all,
I need to run a number of scripts which have a certain phrase on them so I have identified these by;
grep -l 100 *script | sort -u
Normally I could just run something along the lines of;
for i in `grep -l 100 *script | sort -u`; do ./${i}; done
However before I run each of... (0 Replies)
Discussion started by: JayC89
0 Replies
6. UNIX for Dummies Questions & Answers
a=`grep -i a.sh filename.sh|cut -d "|" -f4`
b=`expr $a + 1`
filename=`grep -i a.sh filename.sh`
while read line
do
echo $line
echo $filename
if
then
echo "entered if"
nawk ' BEGIN { FS="|"; OFS="|" }
{ sub('$a', '$b', $4)
print $0}' filename.sh
fi
echo "exit if"
done <... (1 Reply)
Discussion started by: hs.giri
1 Replies
7. UNIX for Advanced & Expert Users
a=`grep -i a.sh filename.sh|cut -d "|" -f4`
b=`expr $a + 1`
filename=`grep -i a.sh filename.sh`
while read line
do
echo $line
echo $filename
if
then
echo "entered if"
nawk ' BEGIN { FS="|"; OFS="|" }
{ sub('$a', '$b', $4)
print $0}' filename.sh
fi
echo "exit if"
done <... (1 Reply)
Discussion started by: hs.giri
1 Replies
8. Shell Programming and Scripting
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies
9. UNIX for Dummies Questions & Answers
Hi...
I m working on UNIX z/OS. Actually i have to pass the parameters from the JCL to java-db2 program thru PARM. I am able to pass the arguments but the problem occured is, it is throwing an exception while loading the db2 driver as 'Javaclassnotfound:com.ibm.db2.jcc.DB2Driver'... (0 Replies)
Discussion started by: Sujatha Gowda
0 Replies