Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

search/replace

I have a bunch of files that all end in
*.sql*
I need to replace all of the ";" with " ".
I have a little script called sr.cgi but it only works one file at a time.  Can anyone tell me a quick command line way to do this?
0
asago
Asked:
asago
  • 3
  • 2
  • 2
  • +1
1 Solution
 
n0thingCommented:
Do you have perl on your system ??
0
 
mikegrbCommented:
you should also be able to accomplish what it appears you desire with sed
0
 
asagoAuthor Commented:
I have access to both.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ozoCommented:
What command line are you now using?
0
 
mikegrbCommented:
perl -i -ne 's/;/ /g; print;' *.sql

That should do it... if not let me know of any errors or some such that you get and I will fix it up :)
0
 
ozoCommented:
 or
perl -i -pe 'tr/;/ /' *.sql*
0
 
mikegrbCommented:
Yes, tr/// would be faster and I guess print isn't required

. /me consults docs ...

yes print isn't required as ozo the master of all things technologically related has pointed out (note this *IS* a complement meant to be taken positivley :)
0
 
asagoAuthor Commented:
Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now