Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vloryan

macrumors member
Original poster
Jan 11, 2014
57
0
How can i delete
Code:
<br />
from a txt file using Applescript or shell script?

thanks!
 

vloryan

macrumors member
Original poster
Jan 11, 2014
57
0
At least 7 files per folder. Files shall be edited and overwritten.
 

briloronmacrumo

macrumors 6502a
Jan 25, 2008
533
341
USA
TextWrangler

How can i delete <br /> from a txt file using Applescript or shell script?
TextWrangler provides powerful multi-file search and replace ( including grep if needed ) and might prove more effective and less technically challenging than a script. Rich Siegel and the great developers at Bare Bones are somehow able to offer this awesome tool at no charge. Anyway, just a thought since, on the surface, your editing needs appear basic. I have no affiliation with Bare Bones or the product. Just a happy user.
 

JustMartin

macrumors 6502a
Feb 28, 2012
787
271
UK
If you wanted to do it a a shell script, you could iterate through the files and run sed on them

It would look something like this

Code:
for each filename in /myDirectory do
  sed -n -e '/<br \/>/d' filename
end for

But, as a warning. I have not tested this code, this is simply an approach that you can start from. Try googling 'loop through files with bash' and 'sed guides'. I strongly advise that you start working this stuff out for yourself. I don't think the kind of spoon feeding you're getting here is in your best interests.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.