10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, i had a problem running a script , and after investigation found its all to do with the quotes:
cat file1
line1
val1
val2
line2
val1
val2
line3
val1
val2
awk 'BEGIN {RS="\n\n"; FS="\n";} {print $1 $2}' file1
This gives me the wrong output: (5 Replies)
Discussion started by: andy391791
5 Replies
2. Shell Programming and Scripting
I am trying to re-format a .csv file using awk. I have 6 fields in the .csv file. Some of the fields are enclosed in double quotes and contain comma's inside the quotes. awk is breaking this into multiple fields.
Sample lines from the .csv file:
Device Name,Personnel,Date,Solution... (1 Reply)
Discussion started by: jxrst
1 Replies
3. Shell Programming and Scripting
can someone help me with this. i keep getting errors:
var1="MaxClients"
var2="java|could not.*problem found|panic() failure seen|aborting "
awk 'NR>=1&&NR<=10 && /'${var1}'/ && !/'${var2}'/ {++c}c==3{o=$0 RS $0 RS $0; print o; c=0}' log
when i run the above, i keep getting:
awk:... (3 Replies)
Discussion started by: SkySmart
3 Replies
4. Shell Programming and Scripting
I want to execute awk command without quotes.
who am i | awk {'print $2'}
above code should be something like:
who am i | awk {print $2}
Why such weird requirement?
Im assigning command to a variable, hence i need to escape the quotes.
e.g:
x='who am i | awk {\'print $2\'}'
I want... (11 Replies)
Discussion started by: Arun_Linux
11 Replies
5. Shell Programming and Scripting
Hi
I read somewhere that when using double quotes in awk; variables gets expanded else it doesn't.
So I tried to use the double quotes inside an awk statement as below:
from_instance_trans=`awk "/INPUT =\"$frm_inst\"/,/<\/TRANSFORMATION>/" $xml_object | grep -w "<TRANSFIELD" | awk... (9 Replies)
Discussion started by: dips_ag
9 Replies
6. Shell Programming and Scripting
i want to print the statement below using awk,but i am unable to get the quotes
("22345",1,"Thank you");
How can i do this (5 Replies)
Discussion started by: tomjones
5 Replies
7. Shell Programming and Scripting
Hi,
I am generating html code using cshell, but i am having one problem while printing double quotes,
I need to write following code in file. where $var contains list of web address
<a href="$var">$var</a>
So i am using
echo "<a href="$var">$var</a>" > file.html
But with this " in... (4 Replies)
Discussion started by: sarbjit
4 Replies
8. Shell Programming and Scripting
Hi All,
I have multiple lines in a file like:-
"abc" def "ghi" jkl "mno" 1
I want to print in output:-
abc/ghi/mno 1
How can I do this in perl?
Regrds,
Nilabh
-----Post Update-----
Additional info:-
The last field of the file should be output as it is.In the above example 1 is... (6 Replies)
Discussion started by: nilabh_s
6 Replies
9. Shell Programming and Scripting
Hi,
I have a perl script which generates an LDAP report in CSV Format.
Issue: Some of attribute values has double-quotes as fed by users. I dont want to print those double-quotes while printing the attribute values.
Please let us know how I can overcome this issue.
Thank You.
... (2 Replies)
Discussion started by: gazalinawaz
2 Replies
10. UNIX for Dummies Questions & Answers
I'm building a file with sql delete statements. I need to print the single quotes for the where clause.
i.e.
delete from Command where CommandName = 'SomeName';
I have the following in my script
input=$(pwd)/Cmnd.csv
i=0
while read line
do
if test $i -ge 1;
then
... (2 Replies)
Discussion started by: orahi001
2 Replies