Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel VBA - open text file, replace text, save file?

I have a spreadsheet with 287 rows.

Column 1 is a short text string. (string1)
Column 2 is a slightly different text string. (string2)

I need to search through approximately 25,000 short text files (in a
variety of different folders) and REPLACE all occurences of string1
with string2.

Can I [fairly easily] write a VBA routine to do this automatically?
It's going to take me DAYS to make all the changes by hand. If I
can't do it with Excel is there another tool that would do the trick?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA - open text file, replace text, save file?


I used this yesterday for word docs but don't see why it wouldn't wor
for Excel. Let me know either way.

http://word.mvps.org/FAQs/MacrosVBA/BatchFR.ht

--
christia

-----------------------------------------------------------------------
christian's Profile: http://www.excelforum.com/member.php...fo&userid=1436
View this thread: http://www.excelforum.com/showthread.php?threadid=26532

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Excel VBA - open text file, replace text, save file?

I think the most difficult part is gonna be specifying those 25,000 text files.

If you can do that (maybe a list in column A of another worksheet???), you could
loop through those files and run a macro based on the code in this thread:

http://google.com/groups?threadm=1f5...0a %40phx.gbl



Cybert wrote:

I have a spreadsheet with 287 rows.

Column 1 is a short text string. (string1)
Column 2 is a slightly different text string. (string2)

I need to search through approximately 25,000 short text files (in a
variety of different folders) and REPLACE all occurences of string1
with string2.

Can I [fairly easily] write a VBA routine to do this automatically?
It's going to take me DAYS to make all the changes by hand. If I
can't do it with Excel is there another tool that would do the trick?


--

Dave Peterson

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
How do I save an excel file as a file with undelimited text Lori Excel Discussion (Misc queries) 3 October 16th 07 11:04 PM
How do you save an excel file to be read as IBM-type text file ? Dee Franklin Excel Worksheet Functions 2 October 10th 06 02:46 AM
How can I save a file as a comma-delimited text file in Excel? LAM Excel Discussion (Misc queries) 1 May 3rd 05 10:24 PM
Excel VBA to save .xls file as UTF-8 text file match5man Excel Programming 0 June 3rd 04 11:41 AM
Open delimited text file to excel without changing data in that file zohanc Excel Programming 1 October 3rd 03 01:06 AM


All times are GMT +1. The time now is 05:19 PM.

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

About Us

"It's about Microsoft Excel"