0

I was just wondering if it would at all be possible to edit a notepad file programatically where I have a CTL file with rows of data that get entered into a database.

example:

Load Data
INFILE*
Replace
INTO table <table>
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(column1,column2,column3)
BEGINDATA
"data1","data1","data1"
"data2","data2","data2"
"data3","data3","data3"

Since I can't really query the textfile(that i know of) is there anyway I could programtacically update the data on this ctl file through vb.net?

Thanks!

Criel
  • 805
  • 1
  • 14
  • 32
  • 1
    Excuse my naivety, but what is a CTL file? – Steve May 01 '13 at 18:52
  • It's the control file I use to load data into an Oracle database – Criel May 01 '13 at 19:16
  • possible duplicate of [How to read a file and write into a text file?](http://stackoverflow.com/questions/1404758/how-to-read-a-file-and-write-into-a-text-file) – Gert Arnold May 01 '13 at 19:50
  • A possible way to do this is to create a template file, read in the file, replace the tokens, then write out the result. e.g. If just the data changes place a {0} as a token in the template then replace the {0} with the current data. Or you could replace all the characters between BEGINDATA and ENDDATA with your fresh set of data. – rheitzman May 07 '13 at 19:52

0 Answers0