Hi,
I have a problem with a replace of a pattern in a file.
Example of file:
CREATE TABLE TEST.TEST
(
ID_SOGGETTO BIGINT NOT NULL,
ENTE VARCHAR(64))
UNIQUE PRIMARY INDEX ( ID_SOGGETTO ,ENTE );
I want to replace the red pattern with another text:
i want to replace the text after the character ")" at the end of line up to the ";" character.
The file contain multiple CREATE TABLE statements.
I tryed with sed command..
Your specification is very vague. Will the last line of your CREATE TABLE statement always be a one single index definition? And, there is nothing (= empty string) between ")" and ";" in your sample, unless you are talking of the previous line's ")", which cannot be considered in line based tools like awk or sed.
Applying a wild guess, I'd propose sth like
If that does not suit you, please be way more specific, providing a desired output sample.
EDIT: obviously we are NOT talking of single index definitions. And, I'd bet, the replacemant text will not be constant but vary from table definition to table definition...
I have a csv which has lot of columns . I was looking for an awk script which would extract a column twice. for the first occurance the header and data needs to be intact but for the second occurance i want to replace the header name since it a duplicate and extract year value which is in ddmmyy... (10 Replies)
I have a file change.sed
more change.sed
I fire the below command inorder to replace "190.169.11.15" with "10.4.112.240" in proxy.logsed -f change.sed proxy.log proxy.log has the below entry
more proxy.log
The command replaces both 190.169.11.15 & 190.169.11.155 as below:
I am expecting... (17 Replies)
Hi,
I have the below data in a file in one of the path,
101 02100002111406893401207310900A094101xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
5200xxxxxxxxxx D18000_1 CCDXXXXXXX JUL 31201207 1140689340000001
622113010547999999999003 000333333334RE ... (1 Reply)
Hello,
Although I have found similar questions, I could not find
advice that could help with my problem. The issue:
I am trying to replace all occurrences of a regex, but
I cannot make the regex groups work together.
This is a simple input test file:
The Vedanta Philosophy... (3 Replies)
Hi All,
point 1. I have n number of environment variable files in different folders. All file names are ending with one thing common ie, *envset.sh
point 2. All these contains Varilables and some other information like following
*envset.sh ===>>
... (3 Replies)
Hello Guys
i am seeking help here is my issue
I have several files i need to find "&" char and replcae with & or '
1) It may be possible that in a file there are several occurance of &, & or '
but need to replace only & whihc does not have amp; and apos;
2)it may be the case out of... (7 Replies)
I have the following problem:
I have two files: S containing sentences (one in each row) and W containing files (one in each row). It might look like this:
S:
a b c apple d.
e f orange g.
h banana i j.
W:
orange
banana
apple
My task is to replace in S all words that appear in W... (2 Replies)
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Hi,
I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ).
Eg:
0000001
0000220
0001235
0000022
0000023
...........
.........
........
Like this i am having around 1500000 records. After adding... (23 Replies)
I have no idea really what I am doing but I am very good at copy-paste code from smart people :)
I found it a while back but can't get it now, I am looking for a simple command line prompt command to search and replace text in multiple files.
I have a website with a ton of pages and all links... (6 Replies)