10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
So I'm writing a script which tries to parse human-readable addresses. Part of it is this:
print $2, implode(A,1,AN," "), CITY, PROV, POST, COUNTRY, CITYCOUNT>2;
CITYCOUNT is a variable between 0 and 3 counting the number of words in a city name. I'm trying to prnt 1 wherever that's greater... (5 Replies)
Discussion started by: Corona688
5 Replies
2. Shell Programming and Scripting
The bash bash below extracts the oldest folder from a directory and stores it in filename
That result will match a line in bold in input. In the matching line there is an_xxx digit in italics that
(once the leading zero is removed) will match a line in link. That is the lint to print in output.... (2 Replies)
Discussion started by: cmccabe
2 Replies
3. Shell Programming and Scripting
i have this variable:
varT="1--2--3--5"
i want to use awk to print field 3 from this variable. i dont want to do the "echo $varT".
but here's my awk code:
awk -v valA="$varT" "BEGIN {print valA}"
this prints the entire line. i feel like i'm so close to getting what i want. i... (4 Replies)
Discussion started by: SkySmart
4 Replies
4. UNIX for Dummies Questions & Answers
I almost reach my objective (Youhouuu !!!!)
But I really don't understand why it doesn't work until the end... :wall:
For clarity's sake I am taking a very simple example. The operations I am doing in the script (gsub and print) really don't have any importance !!! I just matter about... (10 Replies)
Discussion started by: beca123456
10 Replies
5. Shell Programming and Scripting
I have list of files:
ls
a.pdf
b.pdf
c.pdf
and so on...
and I have a file like this:
cat file1
apple
mango
pear
and so on...
I want to rename my file like this: (7 Replies)
Discussion started by: zorrox
7 Replies
6. Shell Programming and Scripting
I have a system stat command running which generates data after 5 sec or so. I pass this data to awk and do some calculation to present the data differently. Once done now I want to pass this data to file as and when generated but doesn't work..unless the first command completes successfully.... (6 Replies)
Discussion started by: learnscript
6 Replies
7. Shell Programming and Scripting
:b:Hi All,
I have a part of a script below:
var1="value1"
awk 'BEGIN {printf("%36s \n ","value1")}'
Instead of directly giving the "value1" , I need to give using "var1" in the above awk statement.
Is this possible?
If so, what is the modified awk command?
Thanks in advance
JS (1 Reply)
Discussion started by: jisha
1 Replies
8. Shell Programming and Scripting
hi,
i have store variable in $var i want to print it in $3 of file using awk.
how can i do it?
file :
var1,var2,var3
var5,var6,var7
var8,var9,var10
.
.
.
i want to print $var in $3 ( for example var3 or var7 or var10)
thanks (3 Replies)
Discussion started by: kamel.seg
3 Replies
9. Shell Programming and Scripting
Hi,
i use awk -F to print three variable delimited by comma $1 $2 $3
if $2=="" i want to extract this information missing from another file using awk -v + some process.
but the problem i can't use the two awk together cause of redirection
there's a solution.
note: i can't use another... (1 Reply)
Discussion started by: kamel.seg
1 Replies
10. Shell Programming and Scripting
i read the variable ph from file and i wanna to print it in awk.
example
ph=`cat tmpbatch`
tail h.txt|grep "| |"|awk -F"|" '{ print "@unpdx.sql",$5 }'"$ph"
i try this but it does not work (8 Replies)
Discussion started by: kazanoova2
8 Replies