processing a text file in macro

isshwar

New Member
Joined
May 26, 2011
Messages
2
hi,
i have a text file and i need to process that. the processsing should be like this.
in my file whenever i encounter a string 'record' i should start writing the contents form there to the next occurence of the string 'record' in a seperate text file. this should happen until the end of file. i am not native in using macros. pls help?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
hi,
i have a text file and i need to process that. the processsing should be like this.
in my file whenever i encounter a string 'record' i should start writing the contents form there to the next occurence of the string 'record' in a seperate text file. this should happen until the end of file. i am not native in using macros. pls help?

my input file would look like this
reord name 1
asdfklasdk
safasd
record name 2
oplsadfokdsa
psldf;a'f
record name 3
dfsafasp
l;kasl;df ;salf
so for this type of input file it should create three output text files for each record name and the text file should contain the data between the record lines.
 
Upvote 0

Forum statistics

Threads
1,223,789
Messages
6,174,580
Members
452,573
Latest member
Cpiet

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top