Forum Discussion
joffre
13 years agoRegular Contributor
Hey Robert.
About my doubt about search and replace text inside the file, I did it by using the following code:
But how will I remove EVERYTHING in my new file that I don't need?
An example:
The file has:
And all I need is:
Is that even possible?
P.S.1: This is just an example of a file. In the same file I have lots of CREATE TABLE, ALTER TABLE, etc... But all I'll always need is the CREATE TABLE entire line.
P.S.2: Sorry about all this posts, but I don't have permission to edit my posts.
About my doubt about search and replace text inside the file, I did it by using the following code:
s = aqFile.ReadWholeTextFile("D:\Scripts\Scripts\1.LGComponentes\Oracle\1.sql", aqFile.ctUTF8)
s = aqString.Replace(s, "CREATE TABLE", "SELECT * FROM")
If (aqFile.Create("D:\Scripts\Scripts\1.LGComponentes\Oracle\1-Sel.txt") = 0) Then
Call aqFile.WriteToTextFile("D:\Scripts\Scripts\1.LGComponentes\Oracle\1.txt", s, aqFile.ctUTF8)
Call Log.Message("Sucesso!")
Call aqFile.Rename("D:\Scripts\Scripts\1.LGComponentes\Oracle\1.txt", "D:\Scripts\Scripts\1.LGComponentes\Oracle\1-Select.sql")
Else
Call Log.Error("Falha")
End If
But how will I remove EVERYTHING in my new file that I don't need?
An example:
The file has:
SELECT DECODE(COUNT(*), 0, 'FALSE', 1, 'TRUE') FROM ALL_TABLES WHERE TABLE_NAME='LGID'(
TABELA VARCHAR2(60) NOT NULL,
ULTIMO_ID NUMBER(18) NOT NULL
)
PCTFREE 10
PCTUSED 60
INITRANS 1
MAXTRANS 255
TABLESPACE TS_FPW_DAT_01
STORAGE (
INITIAL 40960
NEXT 40960
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS 200
)/
And all I need is:
SELECT DECODE(COUNT(*), 0, 'FALSE', 1, 'TRUE') FROM ALL_TABLES WHERE TABLE_NAME='LGID'
Is that even possible?
P.S.1: This is just an example of a file. In the same file I have lots of CREATE TABLE, ALTER TABLE, etc... But all I'll always need is the CREATE TABLE entire line.
P.S.2: Sorry about all this posts, but I don't have permission to edit my posts.
Related Content
Recent Discussions
- 8 hours agod_gfleetwood92
- 10 hours agoFFCB