View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default Manipulating text file data

As long as "</Placemark" occurs only once in the input file, and the new
information is simply one string, you could try something like

Dim NewInformation As String

NewInformation = "Whatever"

Open "Your Input File" For Binary As #1
Open "Your Output File" For Binary As #2

Put #2, 1, Replace(Input(LOF(1), #1), "</Placemark", _
"</Placemark" & NewInformation)

Close #1
Close #2


"Kingdbag" wrote:


Hi guys,

I have a text file that I am working with that i would like to append
data to sort of.

</Placemark
new information
</Document
</Folder
</kml

I would like to open the file move up between </Placemark and
</Document and add some new data. I' having a hard time finding any
info other than normal inputs or appends anyone have an idea? I'm sure
its simple but im having a major block today, and its driving me nuts!
All using VBA of course I need to get info from a dialog and write it
to text not to a spreadsheet.


--
Kingdbag
------------------------------------------------------------------------
Kingdbag's Profile: http://www.excelforum.com/member.php...o&userid=17900
View this thread: http://www.excelforum.com/showthread...hreadid=515914