I am new to macros and have been reading up on how they work. Because I need to get this project done, I was thinking I should post this question and see if someone might be able to point me in the right direction. Once I get into these macros, I am sure I will be able to build and learn.
Anyway, here is the deal:
I have 100's of files. They have comma delimited text and the beginning of each row looks like this:
What I need to do is search the third column for certain extensions, being ones that I want to exclude. I have a list of these extensions. Examples from above are IDX, CLASS, and SCC.
Once I find a row that has one of those extensions, I want to copy that whole line to a new file (all rows into 1 file)
Then I want to replace the third, fourth and fifth columns with replacement text - always the same.
So this:
29,0,"CLASS","014","000031121.class","","
would become this:
29,0,"TIF","","PlaceHolder.TIF","","
Does this make sense? I have been reading a bunch of your posts and I am guessing this will be a breeze for all you experts. Since I have never made a (successful) macro in ue, I have not gotten there yet.
Any help is greatly appreciated!
Anyway, here is the deal:
I have 100's of files. They have comma delimited text and the beginning of each row looks like this:
Code: Select all
0,0,"DOC","014","000031108.doc","","","",
0,0,"DOC","014","000031109.doc","","","",
0,0,"DOC","014","000031110.doc","","","",
0,0,"DOC","014","000031111.doc","","","",
28,0,"ZIP","014","000031112.zip","","",""
28,0,"SCC","014","000031113.scc","","",""
28,0,"TSV","014","000031114.TSV","","",""
28,0,"TXT","014","000031115.TXT","","",""
28,0,"TSV","014","000031116.TSV","","",""
0,0,"IDX","014","000031117.idx","","","",
29,0,"ZIP","014","000031118.zip","","",""
29,0,"MF","014","000031119.MF","","","","
29,0,"CLASS","014","000031120.class","","
29,0,"CLASS","014","000031121.class","","
Once I find a row that has one of those extensions, I want to copy that whole line to a new file (all rows into 1 file)
Then I want to replace the third, fourth and fifth columns with replacement text - always the same.
So this:
29,0,"CLASS","014","000031121.class","","
would become this:
29,0,"TIF","","PlaceHolder.TIF","","
Does this make sense? I have been reading a bunch of your posts and I am guessing this will be a breeze for all you experts. Since I have never made a (successful) macro in ue, I have not gotten there yet.
Any help is greatly appreciated!