I have run into an interesting issue when writing to a text file. Sorry for the long post.
Background:
I am taking a large Excel spreadsheet, removing the unwanted columns, putting the remaining columns in the right order, and getting them set up for filtering.
I then set four filters and read the required row of columns A, B, C, and D, putting them into their own variables. Then I put all the populated cells in Column E into a list.
So I end up with four variables and a list of numbers.
Now I need to get the following lines written / appended into a text file. The blue text are my variables
update ipsi.standard_scf
set key_eng = '%NewBEMS%' where key_eng = '%CurrentBEMS%' and scf_type = '%ScfType%' and i_std_stand_id in (select i_std_stand_id
from ipsi.standard, ipsi.standard_scf
where stand_id = i_std_stand_id
and corpus_code = '%Corpus%' and doc_number in (
'Number from the list',
'Number from the list',
'Number from the list',
'Number from the list'
));
I am trying to use Write Text to File instead of Send Keys, because I am having issues popping back and forth between the Excel sheet and Notepad++. Send Keys also seems slower and more prone to have errors depending on the speed.
Write Text to File only allows one line of text per command. (As far as I can figure out)
So I have put the entire block of text above in a variable, and send that variable to the Write Text to File.
It writes the text, but it adds unexpected line breaks. Like so...
update ipsi.standard_scf
set key_eng = '2367267
' where key_eng = '2753017
' and scf_type = 'CUSTODIAN
' and i_std_stand_id in (select i_std_stand_id
from ipsi.standard, ipsi.standard_scf
where stand_id = i_std_stand_id
and corpus_code = 'BPS
' and doc_number in (
'Column E list
',
'Column E list
',
'Column E list
',
'Column E list
'
));
My guess is that the percent signs, or at least the 2nd one in each variable, is seen as a special character that is causing this unwanted line break.
Any ideas on how to get my text file to ultimately look like:
update ipsi.standard_scf
set key_eng = '2367267' where key_eng = '2753017' and scf_type = 'CUSTODIAN' and i_std_stand_id in (select i_std_stand_id
from ipsi.standard, ipsi.standard_scf
where stand_id = i_std_stand_id
and corpus_code = 'BPS' and doc_number in (
'Column E list',
'Column E list',
'Column E list',
'Column E list'
));
Frank D. Puthuff
Dell Technology