How to remove unwanted elements from the command line?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to remove unwanted elements from the command line?
# 8  
Old 02-22-2013
Hi Balajesuri,

i did this in the operating system,

Code:
sed 's/^CREATE/& or replace/' fpe_temp_dist_abf_stage2.sql > fpe_temp_dist_abf_stage3.sql

output is still the same, i.e. fpe_temp_dist_abf_stage2.sql is the same as fpe_temp_dist_abf_stage3.sql
Code:
CREATE TABLE FPE_TEMP_DIST_ABF                                                                                         
   (    "THREAD_IDX" NUMBER(3,0),                                                                                        
        "DISC_ID" NUMBER(10,0),                                                                                          
         PRIMARY KEY ("THREAD_IDX", "DISC_ID") ENABLE                                                                    
   ) ORGANIZATION INDEX NOCOMPRESS

---------- Post updated at 06:50 PM ---------- Previous update was at 03:13 PM ----------

the output I have after

Code:
sed 's/\"SUPERB\"\.\"\([^\"]*\)\"/\1/' file

Image Image Image
Code:
  CREATE TABLE ACTIVATED_FILLER
   (    "AD_ID" NUMBER(8,0),
        "FAD_ID" NUMBER(8,0),
        "CF_ID" NUMBER(8,0),
        "ACTIVATE_STATUS" NUMBER,
        "LAST_UPDATE_BY" NUMBER(8,0),
        "LAST_UPDATE_DATE" DATE
   )

so how do i remove the quotes for the columns, i.e desired output is

Code:
  CREATE TABLE ACTIVATED_FILLER
   (    AD_ID NUMBER(8,0),
        FAD_ID NUMBER(8,0),
        CF_ID NUMBER(8,0),
        ACTIVATE_STATUS NUMBER,
        LAST_UPDATE_BY NUMBER(8,0),
        LAST_UPDATE_DATE DATE
   )

thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove unwanted white space

Hi, I have a very big file 25GB with information present in it like $ head ind_stats update index statistics pfirm001.dbo.Office using 200 values go ... (11 Replies)
Discussion started by: sam05121988
11 Replies

2. Shell Programming and Scripting

How to remove unwanted " from string...

I have this Input File with extra double quotes in the middle. Please suggest how to handle this condition. Input File: "123985","SAW CUT CONCRETE SLAB 20"THICK",,"98.57","","EACH","N" "204312","ARMAFLEX-1 3/8 X 3"",,"2.48","","PER FOOT","N" "205745","MISTING HEAD HOLLOW CONE "C"... (3 Replies)
Discussion started by: BICC
3 Replies

3. Shell Programming and Scripting

How to remove unwanted strings?

Hi Guys, Can someone give me a hand on how I can remove unwanted strings like "<Number>" and "</Number>" and retain only the numbers from the input file below. INPUT FILE: <Number>10050000</Number> <Number>1001340001</Number> <Number>1001750002</Number> <Number>100750003</Number>... (8 Replies)
Discussion started by: pinpe
8 Replies

4. Shell Programming and Scripting

remove unwanted text using perl

Hello..I have a text file that need to remove unwanted text. This is the original file. No. Time Source Destination Protocol Info 16 0.649949 10.1.1.101 209.225.11.237 HTTP POST /scripts/cms/xcms.asp HTTP/1.1 ... (9 Replies)
Discussion started by: taxi
9 Replies

5. Shell Programming and Scripting

remove unwanted specific line range

Hello everyone...I have large txt file and I would like to remove unwanted specific line. My data is like this: So I would like to remove from line below No. until line reassambled like this: Thanks... (4 Replies)
Discussion started by: taxi
4 Replies

6. Shell Programming and Scripting

Remove unwanted lines

I have a .xml file, where i need some output. The xml file is like: Code: <?******?></ddddd><sssss>234</dfdffsdf><sdhjh>534</dfdfa>......... /Code I need the output like: code 234 534 . . . /code How can i do it? (5 Replies)
Discussion started by: anupdas
5 Replies

7. Emergency UNIX and Linux Support

Remove Unwanted Libraries - optimizing

We have a huge makefile composing of inclusion of libraries, objects and system libraries to generate a binary. How do we find out that which of the libraries we can remove in the most efficient way? Doing hit and trial method is a waste of time and can during the linking with some post linking... (12 Replies)
Discussion started by: uunniixx
12 Replies

8. Solaris

Remove unwanted packages

I got a system which was installed with SUNWCXall cluster installed on it and i want remove unwanted software like GMNOME, Java Desktop System, Staroffice and numerous other softwares .. i want to do an automated removal of these packages where its uninstalled by itself ..from the is there any... (4 Replies)
Discussion started by: fugitive
4 Replies

9. Shell Programming and Scripting

Remove unwanted XML Tags

I have set of sources and the respective resolution. Please advice how to resolve the same using Unix shell scripting. Source 1: ======= <ext:ContactInfo xmlns:ext="urn:AOL.FLOWS.Extensions"> <ext:InternetEmailAddress>AOL@AOL.COM</ext:InternetEmailAddress> </ext:ContactInfo> Resoultion... (1 Reply)
Discussion started by: ambals123
1 Replies

10. Shell Programming and Scripting

Remove unwanted data?

Hi Can any one help me remove the unwanted data? I would want to remove the complete event id 4910 ( the type there is INFO), that means, I have to remove starting from 7th - 19th lines. can any one of you please help? Thanks, (24 Replies)
Discussion started by: hitmansilentass
24 Replies
Login or Register to Ask a Question