Sponsored Content
Full Discussion: Character replacement
Top Forums Shell Programming and Scripting Character replacement Post 302134767 by piooooter on Monday 3rd of September 2007 10:32:40 AM
Old 09-03-2007
Character replacement

Hi,

I am working on a command that replaces some occurrences of quotation marks in file. The quotation mark cannot be the first or the last character in line and cannot be preceded or followed by a comma.

I am not an expert in regular expressions, but I managed to create the following command.

sed 's/\([^,]\)\"\([^,]\)/\1\"\"\2/g' file.txt

Can you please verify it or tell me how to do it better? Any help will be appreciated.

Regards,
Pit
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed in character replacement in Korn Shell

How do I replace a space " " character at a particular position in a line? e.g. I have a file below $ cat i2 111 002 A a 33 0011 B c 2222 003 C a I want all the 1st spaces to be replaced with forward slash "/" and the 3rd spaces to have 5 spaces to get the output below: 111/002... (8 Replies)
Discussion started by: stevefox
8 Replies

2. Shell Programming and Scripting

KSH - Character Replacement

Hey all. Easy question. I have a (ksh) varaible x. It contains the following (for example): N557788 I want to replace the "N" with a "-". I've done this before but for the life of me I cannot remember how I did it. Thanks. mtw (2 Replies)
Discussion started by: mixxamike
2 Replies

3. Shell Programming and Scripting

Sed-Special character replacement

Hi I want to replace ./testsed.ksh with testsed.ksh ./ is to be removed scriptnm=`sed -e 's/\.///' $0 does not work Please help (3 Replies)
Discussion started by: usshell
3 Replies

4. UNIX for Dummies Questions & Answers

banner character replacement

Can we able to replace the character # in banner command with some other characters. Can we able to blink the character in Kornshell (1 Reply)
Discussion started by: sivakumar.rj
1 Replies

5. Programming

python, character replacement

Hello, I need to do this in python but I'm just learning py and it's quite urgent. I have a script I created and need an interactive python script to modify part of a line. MY SCRIPT #ligand prep. Uses 'ind' prefix. The initial ligand must be ind.pdb. This #generates ind.pdbqt.... (0 Replies)
Discussion started by: gav2251
0 Replies

6. Shell Programming and Scripting

read in a file character by character - replace any unknown ASCII characters with spa

Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/ Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies

7. UNIX for Dummies Questions & Answers

global search and replacement of a non-ascii character

Hi, I need to do a global search and replacement of a non-ascii character. Let me first give the background of my problem. Very frequently, I need to copy set of references from different sources. Typically, a reference would like this: Banumathy et al., 2002 G. Banumathy, V. Singh and U.... (1 Reply)
Discussion started by: effjay
1 Replies

8. Shell Programming and Scripting

sed - replacement file path with variable - Escaping / character

Hi,, I have the line below in a file: $!VarSet |LFDSFN1| = '"E:\APC\Trials\20140705_427_Prototype Trial\Data\T4_20140705_Trial_Cycle_Data_13_T_Norm.txt" "VERSION=100 FILEEXT=\"*.txt\" FILEDESC=\"General Text\" "+""+"TITLE{SEARCH=NONE NAME=\"New Dataset\" LINE=1I want to write a script to change... (2 Replies)
Discussion started by: carlr
2 Replies

9. Shell Programming and Scripting

Trigger email from script if the Special Character replacement is successfull

Hello Gurus, I have a script developed... #!/bin/bash #--------------------------------------------------------------------- # This pScript will remove/replace the special characters fromfiles #--------------------------------------------------------------------- trxdate="`date... (1 Reply)
Discussion started by: nanduedi
1 Replies

10. Shell Programming and Scripting

Special character replacement

Hi Guys, I have a file which needs to be replaced with tab delimited AA§Orgin Name§Mapping based on prod_usa§§§§ BB§Date§2019-08-11 23:30:01§§§§ I am trying below code sed 's// /g' test.txt Expected AA|Orgin Name|Mapping based on prod_usa||| BB|Date|2019-08-11 23:30:01|||| (6 Replies)
Discussion started by: rohit_shinez
6 Replies
NDB_MGM(1)						       MySQL Database System							NDB_MGM(1)

NAME
ndb_mgm - the MySQL Cluster management client SYNOPSIS
ndb_mgm options DESCRIPTION
The ndb_mgm management client process is actually not needed to run the cluster. Its value lies in providing a set of commands for checking the cluster's status, starting backups, and performing other administrative functions. The management client accesses the management server using a C API. Advanced users can also employ this API for programming dedicated management processes to perform tasks similar to those performed by ndb_mgm. To start the management client, it is necessary to supply the host name and port number of the management server: shell> ndb_mgm [host_name [port_num]] For example: shell> ndb_mgm ndb_mgmd.mysql.com 1186 The default host name and port number are localhost and 1186, respectively. The following table includes options that are specific to the MySQL Cluster management client program ndb_mgm. Additional descriptions follow the table. For options common to most MySQL Cluster programs (including ndb_mgm), see Options Common to MySQL Cluster Programs(1). Table 17.13. ndb_mgm Options and Variables: MySQL Cluster NDB 7.2 +--------------------------+-----------------------------+-------------------------------------+ |Format | Description | Added / Removed | +--------------------------+-----------------------------+-------------------------------------+ | | Specify number of tries for | | | --try-reconnect=#, | connecting to ndb_mgmd (0 = | All MySQL 5.5 based releases | | | infinite) | | | -t | | | +--------------------------+-----------------------------+-------------------------------------+ | | Execute command and exit | | | --execute=name, | | All MySQL 5.5 based releases | | | | | | -e | | | +--------------------------+-----------------------------+-------------------------------------+ o --execute=command, -e command +--------------------+----------------+ |Command-Line Format | --execute=name | +--------------------+----------------+ | | -e | +--------------------+----------------+ This option can be used to send a command to the MySQL Cluster management client from the system shell. For example, either of the following is equivalent to executing SHOW in the management client: shell> ndb_mgm -e "SHOW" shell> ndb_mgm --execute="SHOW" This is analogous to how the --execute or -e option works with the mysql command-line client. See Section 4.2.3.1, "Using Options on the Command Line". Note If the management client command to be passed using this option contains any space characters, then the command must be enclosed in quotation marks. Either single or double quotation marks may be used. If the management client command contains no space characters, the quotation marks are optional. o --try-reconnect=number +--------------------+-------------------+ |Command-Line Format | --try-reconnect=# | +--------------------+-------------------+ | | -t | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | TRUE | +--------------------+---------+---------+ If the connection to the management server is broken, the node tries to reconnect to it every 5 seconds until it succeeds. By using this option, it is possible to limit the number of attempts to number before giving up and reporting an error instead. Additional information about using ndb_mgm can be found in Section 17.5.2, "Commands in the MySQL Cluster Management Client". COPYRIGHT
Copyright (C) 1997, 2014, Oracle and/or its affiliates. All rights reserved. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. AUTHOR
Oracle Corporation (http://dev.mysql.com/). MySQL 5.5 01/30/2014 NDB_MGM(1)
All times are GMT -4. The time now is 11:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy