Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add content (text) to an ASCII based file
#1
I write 98% of my research oriented macros for the academic research suite Nota Bene. The data is stored in ASCII.
I need to add simple content to these files such as:

Find "~ct#"

THEN go to the end of that line and add a time stamp from the clipboard, such as "cit#-1506061411111"

HERE IS WHAT I WOULD LIKE TO DO:

I want this to happen 'behind the scenes' and
Open this as an ASCII document in a hidden state (or minimized)
Find the "~ct#" (I think I NOW know how to do this)
paste the content from the clipboard at the end of that line.

SO HERE IS MY QUESTION:

What is the best way to do that? Or is there some way to treat an ASCII file that is hidden?

I can do it now by:
-opening as text with Notepad
-find the text via 'windowtext.find'
-keyboard to the end of the line
-paste from the clipboard

BUT I am just wondering IF there is a more efficient way to do this?
#2
Quote:-opening as text with Notepad
-find the text via 'windowtext.find'
-keyboard to the end of the line
-paste from the clipboard

Get file data with str.getfile. It stores file text in the str variable.
Find the text with one of QM 'find string' functions.
Insert text. Or find-replace in one step.
Save with str.setfile.
#3
PERFECT!!! very simple and I should have thought of something like this!

May I say "Thank You" once again

Kent


Forum Jump:


Users browsing this thread: 1 Guest(s)