Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

search/replace

Posted on 1998-07-17
8
217 Views
Last Modified: 2010-04-21
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
Comment
Question by:asago
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 5

Expert Comment

by:n0thing
ID: 2008845
Do you have perl on your system ??
0
 
LVL 1

Expert Comment

by:mikegrb
ID: 2008846
you should also be able to accomplish what it appears you desire with sed
0
 

Author Comment

by:asago
ID: 2008847
I have access to both.
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 84

Expert Comment

by:ozo
ID: 2008848
What command line are you now using?
0
 
LVL 1

Accepted Solution

by:
mikegrb earned 50 total points
ID: 2008849
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
 
LVL 84

Expert Comment

by:ozo
ID: 2008850
 or
perl -i -pe 'tr/;/ /' *.sql*
0
 
LVL 1

Expert Comment

by:mikegrb
ID: 2008851
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
 

Author Comment

by:asago
ID: 2008852
Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question