10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everyone,
I'm trying to write a small script to automatize row data treatment. However, I got some trouble with the awk command.
I want to use awk to extract a define paragraph from a text file. The first and final lines are defined externally in two variables called debut and fin.
I... (2 Replies)
Discussion started by: TeaTimeSF
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
input:
AAA|1
my script (the function is just an example):
gawk 'BEGIN{FS=OFS="|"}
function repeat(str, n, rep, i){
for(i=1; i<=n; i++)
rep=rep str
return rep
}
{
variable_1=repeat($1,$2)
variable_2=repeat($1,$2+1)
variable_3=repeat($1,$2+3)
... (5 Replies)
Discussion started by: beca123456
5 Replies
3. Shell Programming and Scripting
Hi
I am having a file like this
##############################
j=1
while ]
do
temp_5=MODULE$j
awk '
$1 ~ /'${!temp_5}'/ {
do something }1' file1 > file2
((j = j +1 ))
done ###################
Setting the variables like this (8 Replies)
Discussion started by: kshitij
8 Replies
4. Shell Programming and Scripting
Hi,
I'm a first timer with Unix so pardon my ignorance.
I'm trying to read a comma separated file from the same folder where the script is and insert the value in a DB2 table.
I'm using AWK for the same. I'm getting `)' not expected error.
I'm not sure but for me it doesn't look like detailed... (8 Replies)
Discussion started by: Kabira Speaking
8 Replies
5. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
couldn't print out stored variable in awk
2. Relevant commands, code, scripts, algorithms:
i have in a... (5 Replies)
Discussion started by: ymc1g11
5 Replies
6. Shell Programming and Scripting
HI,
This is the code I am using:
awk -v aaa="connect" 'BEGIN {IGNORECASE} /aaa/,/!/ {print NR}' bb
This does not throw any error but it does not work. Pls help
Thanks. (4 Replies)
Discussion started by: sudvishw
4 Replies
7. Shell Programming and Scripting
Okay, so I am trying to use a count variable to reference the column of output sent from an echo statement. So I am trying to do this
#!/bin/bash
CURRENT=$PWD
VAR=3
CHANGE=`echo $CURRENT | awk -F "/" '{ print \$$VAR }'`
This instead of giving me the third instance after the "/" gives... (4 Replies)
Discussion started by: mkjp2011
4 Replies
8. Shell Programming and Scripting
Hi
How are you people ..
I am facing another problem regarding awk below is my code
-bash-3.00$ export a=10
-bash-3.00$ echo $a
10
-bash-3.00$ echo "" | nawk -v var=$a ' { if(var=10) { print "abc" } else { print "def"} } '
abc
-bash-3.00$ echo "" | nawk -v var=$a ' { if(var==10)... (2 Replies)
Discussion started by: aishsimplesweet
2 Replies
9. Shell Programming and Scripting
I would like to use the result of a query in another query. How do I redirect/add the output to another variable?
$result = odbc_exec($connect, $query);
while ($row = odbc_fetch_array($result)) {
echo $row,"\n";
}
odbc_close($connect);
?>
This will output hostnames:
host1... (0 Replies)
Discussion started by: hazno
0 Replies
10. Shell Programming and Scripting
Hi,
When i execute the below statement , the value is not getting stored in the variable.
AnneeExercice=`sqlplus $LOGSQL/$PASSWORDSQL << FIN >> $GEMOLOG/gemo_reprev_reel_data_ventil_$filiale.trc
SELECT bi09exercice
FROM bi09_scenario
WHERE bi09idfiliale=UPPER('de')
AND ... (1 Reply)
Discussion started by: krishna_gnv
1 Replies