How to get rid of double quote in sed.

Hi,

i am using sed command to grep just a valuable data for my report generating. Thanks to the person who assists me on before thread. the problem that i encounter now is when i executed below command
The output will give me like below output in between the data, there is a double quote. How do i get rid of it.

I know it can be formated during when i print it out but how to do that.

example = ids-job-identifier = "dlm_01:1:180748"

Command sed execute:

Sample Output that i get:

thanks

sed -e 's/.*\('"$dsmid"' = \"[^"]*\"\).*\('"$jqmid"' = \"[^"]*\"\)..*/\1/g' \
  -e 's/"//g' $logDir/$reportlogname.aim.log

You could also avoid grabbing the double quotes in the first place, but that is slightly more complex, and doesn't easily let you remove any double quotes outside of the search expression. (I gather you want to remove the double quotes around the dpa-job-identifier value, too.)

you don't have to grapple with that mess sed gives you if you use double quotes as field delimiters. I do not understand your requirement enough but i can tell you, there's better ways to what you want without that much regexp.

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.

Command used:

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

Output Currently I get:

sed -e 's/.*\('"$dsmid"' = \"[^"]*\"\).*\('"$jqmid"' = \"[^"]*\"\).*\('"$ldest"' = \"[^"]*\"\).*\('"$pdest"' = \"[^"]*\"\).*\('"$jstate"' = \"[^"]*\"\).*\('"$jstatus"' = \"[^"]*\"\).*\('"$proctime"' = \"[^"]*\"\).*/\1 \2 \3 \4 \5 \6 \7/g' -e 's/"//g' $logDir/$reportlogname.aim.log > $logDir/trim.$reportlogname.aim.log

without too much regexp, here's an easier to read approach

awk 'BEGIN{ RS="\" ";}
/dpa-job-identifier|logical-destination|job-completion-status|processing-time/{
 gsub(/"/,"")
 print $0 
}' file

output:

# ./testnew.sh
dpa-job-identifier = jqm_APJFIREWALL:779749767
logical-destination = cbax91pc17
job-completion-status = success
processing-time = 1
ids-job-identifier = dlm_01:1:180748
dpa-job-identifier = jqm_APJFIREWALL02:1270283169
logical-destination = jpnx198
job-completion-status = success
processing-time = 8

i leave it to you to arrange the output

Hi ghostdog74 and era,

Thanks for your assistance. It work now for me.