KORAY - IT system consulting

Friday, July 18, 2008

How to search and replace text in big files

image

you can also use sed. I used the following command

perl -pi -w -e 's/search/replace/g;' *.sql
-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop

for example you can convert oracle dates to mysql in the following way

image

Posted by Koray Güclü at 4:46 AM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

LinkWithin

Related Posts Plugin for WordPress, Blogger...

Blog Archive

  • ►  2014 (5)
    • ►  August (1)
    • ►  July (1)
    • ►  March (2)
    • ►  February (1)
  • ►  2013 (16)
    • ►  December (1)
    • ►  November (4)
    • ►  October (5)
    • ►  July (1)
    • ►  June (2)
    • ►  May (2)
    • ►  April (1)
  • ►  2012 (7)
    • ►  December (3)
    • ►  November (1)
    • ►  October (2)
    • ►  July (1)
  • ►  2011 (5)
    • ►  December (1)
    • ►  July (3)
    • ►  March (1)
  • ►  2010 (7)
    • ►  September (3)
    • ►  July (1)
    • ►  June (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2009 (9)
    • ►  November (1)
    • ►  September (2)
    • ►  June (1)
    • ►  April (1)
    • ►  February (2)
    • ►  January (2)
  • ▼  2008 (14)
    • ►  December (1)
    • ►  November (1)
    • ►  August (3)
    • ▼  July (6)
      • Business Growth
      • Open Source Content Management Software
      • DEBUGGING YOUR SQLs WITH A JDBC DRIVER
      • How to search and replace text in big files
      • Free alternatives to TOAD
      • Preparing a JAVA development environment
    • ►  April (3)
Simple theme. Powered by Blogger.