Solved

search/replace

Posted on 1998-07-17
8
214 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
 
LVL 84

Expert Comment

by:ozo
ID: 2008848
What command line are you now using?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now