Sponsored Content
Top Forums UNIX for Beginners Questions & Answers sed command to replace consecutive double quotes Post 303007894 by Don Cragun on Thursday 23rd of November 2017 07:15:32 AM
Old 11-23-2017
The sample data you provided in post #1 shows the vertical bar character as a field terminator; not a field separator (since there is no data after the last vertical bar on a line). To produce the output you requested with sed, one could try:
Code:
sed 's/"//g
s/^/"/
s/|/"|"/g
s/"$//' filename

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace multiple blanks within double quotes

I have various column names within double quotes, separated by commas. Example: "column one", "column number two", "this is column number three", anothercolumn, yetanothercolumn I need to eliminate the double quotes and replace the blanks within the double quotes by underscores, giving: ... (5 Replies)
Discussion started by: jgrogan
5 Replies

2. Shell Programming and Scripting

To Replace comma with Pipe inside double quotes

Hi, I have a requirement to replace the comma's inside the double quotes. The comma's inside the double quotes will get changed dynamically. Input Record: "Washington, DC,Prabhu,aju",New York Output Record: "Washington| DC|Prabhu|aju",New York I tried with the below command but it... (3 Replies)
Discussion started by: prabhutkl
3 Replies

3. UNIX for Dummies Questions & Answers

How to replace double quotes in to ascii value?

Hi, I am getting the data from text file and it contains comma and double quootes. Eg: text file like this: Travelling up Cattai Ridge Rd, going through the "S" bends at the top. Felt a "pull" and pain in groin area, on right side after lifting at work. Repeat "twisting" while working manual... (4 Replies)
Discussion started by: rajesh4851
4 Replies

4. Shell Programming and Scripting

Replace double double quotes using AWK/SED

Hi, I have data as "01/22/97-"aaaaaaaaaaaaaaaaa""aaa""aabbbbbbbbcccccc""zbcd""dddddddddeeeeeeeeefffffff" I want to remove only the Consequitive double quotes and not the one which occurs single. My O/P must be ... (2 Replies)
Discussion started by: Bhuvaneswari
2 Replies

5. Shell Programming and Scripting

How to replace spaces excluding those within double quotes and after backslash?

In bash or perl, I would like to know how to substitute a null character (0x00) for every white space without changing the white spaces inside the block of double quotes and the white space immediately following a backslash. Suppose that sample.txt consists of the following line. "b 1" c\ 2 ... (2 Replies)
Discussion started by: LessNux
2 Replies

6. Shell Programming and Scripting

HELP with AWK or SED. Need to replace the commas between double quotes in CSV file

Hello experts, I need to validate a csv file which contains data like this: Sample.csv "ABCD","I",23,0,9,,"23/12/2012","OK","Street,State, 91135",0 "ABCD","I",23,0,9,,"23/12/2012","OK","Street,State, 91135",0 I just need to check if all the records contain exactly the number of... (5 Replies)
Discussion started by: shell_boy23
5 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

sed command to replace string that contain blackslash,double quotes

Hi All, I have been trying to replace a string using the sed command string value contain blackslash and double quotes. I am not a expert writer of unix script but do try not to ask question. I have almost given up. Hope you all can give me some suggestion I want to replace a place string... (6 Replies)
Discussion started by: thanush9sep
6 Replies

9. Shell Programming and Scripting

Replace Double quotes within double quotes in a column with space while loading a CSV file

Hi All, I'm unable to load the data using sql loader where there are double quotes within the double quotes As these are optionally enclosed by double quotes. Sample Data : "221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22" Refurbished - Airwave","Supply... (6 Replies)
Discussion started by: mlavanya
6 Replies

10. Shell Programming and Scripting

Removing consecutive double quotes

Hi I have a .csv file and when opened in notepad looks like this gggg,nnnn,"last,first","llll""",nnn So, Here I would like the ouput as below gggg,nnnn,"last,first","llll",nnn i.e replace all two double quotes into one. How could I do that? This file is being processed by another... (5 Replies)
Discussion started by: dnat
5 Replies
stl_key(5)							File Formats Manual							stl_key(5)

Name
       stl_key - setld kit manufacturing key file

Description
       The manufacturing key files are used by the software kitting program in producing software distribution packages in format.

       A  key file has a global data section and a subset descriptor section. The sections are separated by a line that is empty except for the %%
       character sequence.

       The global section contains the product level attributes of the product. Comments are permitted in this section. They begin with the number
       sign  (#)  character and end at the next newline character.  Attributes are specified by giving the attribute key, an equal sign (=), and a
       value for the attribute.  There must be no white space surrounding the equals sign (=). There are five attributes that must be present with
       non-null values. These are NAME, CODE, VERS, MI, and ROOT.  An explanation of each of the attributes follows:

	  NAME	    The name of the product. The value for NAME is a string of up to 40 characters.

	  CODE	    The 3-character product code for the product, for example, ULT.

	  VERS	    The 3-digit version code for the product, for example, 040.

	  MI	    The pathname of the master inventory file for the product.

	  ROOT	    A  flag with values of 0 or 1. It is used to determine if a ROOT image checksum should be computed for the product image file.
		    There is no ROOT image in any product other than ULTRIX. Set it to 0.

	  RXMAKE    A flag with values of 0 or 1. Setting it to 0 suppresses the manufacture of subset images for distribution on RX50	diskettes.
		    Omitting this attribute from the key file will cause the program to assume a default value of 1. Digital recommends setting it
		    to 0.

	  COMPRESS  A flag with values of 0 or 1. Setting it to 1 causes the subset images to be compressed  using  the  utility,  thereby  saving
		    space  on the distribution media. Setting it to 0 suppresses compression. Omitting this attribute from the key file will cause
		    the program to assign a default value of 0.

       The subset descriptor section contains one subset descriptor for each subset in the product. There is one subset  descriptor  per  line	in
       this section and comments are not permitted.

       A  subset  descriptor  contains subset-specific attributes in four fields separated by TAB (CTRL/I) characters. A description of each field
       follows:

	  SUBSET    This field contains the name of the subset being described by the descriptor. The subset name is composed of the product code,
		    name and version code.

	  DEPENDENCIES
		    A list of subsets on which the described subset depends. If there are no such subsets, the period character (.) is used.  Mul-
		    tiple subset dependencies are separated by a vertical bar character (|).

	  FLAGS     A subset flags value. This is an integer. Bit 0 is used to mark the subset as irremovable. If bit 0 is set, can  never  delete
		    the  subset. Bit 1 is used to mark the subset as optional, otherwise it is mandatory and must be installed from the media when
		    encountered by

	  DESCRIPTION
		    This is a description of the subset in 40 or fewer characters.  It is used in the menu that presents to a user installing  the
		    software. If spaces are desired in this field, the field must be enclosed in single quotes.

       The subset descriptors must be listed in the order in which the subsets are installed by

Restrictions
       The required attributes and default values are not optimal.

       Comments in the subset descriptor section will cause serious problems when encountered by the program.

       TAB formatting in the subset descriptors is tightly enforced by the program.

Examples
       This is an example key file:
	   #	 ULW400.k -
	   #	      ULTRIX WS V4.0 Server 2/2 (VAX) Mfg Key File
	   #
	   #	 "@(#)ULW400.k	2.2 (ULTRIX) 4/12/89"
	   #
	   #	 000  02-mar-1989    ccb
	   #	 Copy from V2.0 (VAX) Sources
	   #	 Revision update for V4.0

	   #% PRODUCT-LEVEL ATTRIBUTES
	   NAME='ULTRIX Worksystem Software V4.0'
	   CODE=UWS
	   VERS=400
	   MI=ULT400.mi
	   ROOT=0
	   RXMAKE=0
	   COMPRESS=1

	   #% SUBSET-LEVEL ATTRIBUTES
	   %%
	   UWSX11400  ULTINET400     0	  'X11/DECwindows User Environment'
	   UWSFONT400 UWSX11400 0    'X11/DECwindows 75dpi Fonts'
	   UWSFONT15400    .	2    'X11/DECwindows 100dpi Fonts'
	   UWSDECW400 .    2	'Optional DECwindows Applications'
	   UWSXDEV400 ULTPGMR400     2	  'Worksystems Development Software'
	   UWSMAN400  ULTDCMT400     2	  'UWS Manual Pages'

See Also
       kits(1), stl_comp(5), stl_ctrl(5), stl_image(5), setld(8)
       Guide to Preparing Software for Distribution on ULTRIX Systems

																	stl_key(5)
All times are GMT -4. The time now is 01:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy