Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Amending a text file


Hi Guy's

I am trying to create a small data with customer info from an exce
worksheet. I am currently able to export the information into a tex
file and understand that by using the code "output" it will create
new file or alternatively using the code "append" and it will add th
info to the end of the file.

However....

Can anyone help me with amending the data once in the text file i thin
it is the replace function but have no idea of the code.

Any help would be fantastic

Thanks
Dav

--
DHalla
-----------------------------------------------------------------------
DHallam's Profile: http://www.excelforum.com/member.php...fo&userid=2525
View this thread: http://www.excelforum.com/showthread.php?threadid=38794

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Amending a text file

You will need to open the file with Random access for Read Write; e.g.
Open "C:\Myfile.txt" for Random Read Write as #1
It needs to be random access so you can read in data, then "skip back" to
re-write that data back to the file. Then use Input# or Get to read the data
from the file; read it in, edit it, and write it back with Write# or Print#
or Put. For details see VBA help files on all these functions and also the
topic "Writing Data to Files."
--
- K Dales


"DHallam" wrote:


Hi Guy's

I am trying to create a small data with customer info from an excel
worksheet. I am currently able to export the information into a text
file and understand that by using the code "output" it will create a
new file or alternatively using the code "append" and it will add the
info to the end of the file.

However....

Can anyone help me with amending the data once in the text file i think
it is the replace function but have no idea of the code.

Any help would be fantastic

Thanks
Dave


--
DHallam
------------------------------------------------------------------------
DHallam's Profile: http://www.excelforum.com/member.php...o&userid=25253
View this thread: http://www.excelforum.com/showthread...hreadid=387948


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Amending a text file


Thanks for your previous reply, unfortunately I am still not able to
solve it however I have now posted a more accurate description of what
it is I believe I require.

Kind Regards
Dave


--
DHallam
------------------------------------------------------------------------
DHallam's Profile: http://www.excelforum.com/member.php...o&userid=25253
View this thread: http://www.excelforum.com/showthread...hreadid=387948

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Amending a formula leerem Excel Discussion (Misc queries) 3 August 4th 08 01:48 PM
Amending another formula leerem Excel Discussion (Misc queries) 3 August 4th 08 10:54 AM
Saving an excel file without it amending the name of file name Jenny Excel Discussion (Misc queries) 0 January 19th 06 09:03 AM
Help amending code Steve Excel Discussion (Misc queries) 4 August 17th 05 03:57 PM
Help with Amending this Code Please [email protected] Excel Worksheet Functions 4 February 1st 05 07:04 PM


All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"