Sponsored Content
Top Forums Shell Programming and Scripting How to get rid of double quote in sed. Post 302219102 by anakiar on Monday 28th of July 2008 05:10:57 AM
Old 07-28-2008
Hi All,

Thanks for the advice. My attention actually to grep a data from file A like below and put the ouput into file B. Currently what i am doing is i used the command below:

Data to grep.
Quote:
ids-job-identifier = "dlm_10:1:178321" dpa-job-identifier = "jqm_APJFIREWALL:779749767" logical-destination = "cbax91pc17" physical-destination = "p_cbax91pc17" job-state = "retained" job-completion-status = "success" processing-time = "1"
ids-job-identifier = "dlm_01:1:180748" dpa-job-identifier = "jqm_APJFIREWALL02:1270283169" logical-destination = "jpnx198" physical-destination = "p_jpnx198" job-state = "retained" job-completion-status = "success" processing-time = "8"
Command used:
Quote:
sed 's/.*\('"$dsmid"' = \"[^"]*\"\).*\('"$jqmid"' = \"[^"]*\"\).*\('"$ldest"' = \"[^"]*\"\).*\('"$pdest"' = \"[^"]*\"\).*\('"$jstate"' = \"[^"]*\"\).*\('"$jstatus"' = \"[^"]*\"\).*\('"$proctime"' = \"[^"]*\"\).*/\1 \2 \3 \4 \5 \6 \7/g' $logDir/$reportlogname.aim.log > $logDir/trim.$reportlogname.aim.log

The problem with this output i get double quote "". So i want to get rid of the double quote "".

Output Currently I get:
Quote:
dpa-job-identifier="jqm_APJ03:1108609378" logical-destination="hpkkdp01" job-completion-status="aborted-in-printing" processing-time="3"
dpa-job-identifier="jqm_APJ03:1108674914" logical-destination="hpkkdp01" job-completion-status="aborted-in-printing" processing-time="4"
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

single or double quote in SED

i m trying the following command but its not working: sed 's/find/\'replace\'/g' myFile but the sed enters into new line # sed 's/find/re\'place/g' myFile > I havn't any idea how to put single quote in my replace string. Your early help woud be appreciated. Thanx (2 Replies)
Discussion started by: asami
2 Replies

2. Shell Programming and Scripting

double-quote inside double-quote

hey all, i made a simple .sh like this: echo "<style media="screen" type="text/css">@import url("main.css");</style>" but the output is: <style media=screen type=text/css>@import url(main.css);</style> i want to keep double-quotes, can anyone help me? thanks (3 Replies)
Discussion started by: indraf
3 Replies

3. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

4. Shell Programming and Scripting

double quote as the delimiter

I'm trying to extract a column from a csv file with either cut or awk but some of the fields contain comma with them: "Field1","Field2, additional info","Field3",...,"Field17",... If I want to extract column 3 and use comma as the delimiter, I'll actually get the additional info bit but not... (4 Replies)
Discussion started by: ivpz
4 Replies

5. Shell Programming and Scripting

getting value between double quote

Can somebody supply me with a simple way to get a value between two double quotes? Example: input = ADR base is "/u01/app/oracle" output = /u01/app/oracle Thanks to all who answer (4 Replies)
Discussion started by: BeefStu
4 Replies

6. Shell Programming and Scripting

Double quote filenames

Hi, I need to double quotes filenames in the following string: /tmp/*file1 /tmp/*file2 /tmp/*file3 /tmp/*file4I tried to do this using sed, but it double quotes every character :wall: $ echo... (10 Replies)
Discussion started by: Subbeh
10 Replies

7. Shell Programming and Scripting

Replace double quotes with a single quote within a double quoted string

Hi Froum. I have tried in vain to find a solution for this problem - I'm trying to replace any double quotes within a quoted string with a single quote, leaving everything else as is. I have the following data: Before: ... (32 Replies)
Discussion started by: pchang
32 Replies

8. Shell Programming and Scripting

Replacing Double Quote in Double Quote incsv file

Hi All , We have source data file as csv file and since data could contain commas ,each attribute is quoted into double quotes.However problem is that some of the attributa data also contain double quotes which is converted to double double quote while creating csv file XLs data : ... (2 Replies)
Discussion started by: Shalini Badal
2 Replies

9. Shell Programming and Scripting

Replacing all but the first and last double quote in a line with a single quote with awk

From: 1,2,3,4,5,This is a test 6,7,8,9,0,"This, is a test" 1,9,2,8,3,"This is a ""test""" 4,7,3,1,8,"""" To: 1,2,3,4,5,This is a test 6,7,8,9,0,"This; is a test" 1,9,2,8,3,"This is a ''test''" 4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Discussion started by: Michael Stora
5 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 09:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy