How to replace first word after x in every line?

Hi
i have a a script which creates many tables/indexes each with diffrent INITIAL value.
I need to grep for word INITIAL and replace the first word after initial ( which is number ) with 50K. how can i do this?
some sample entries are
INITIAL 2097152
INITIAL 458752
Thanks

thanks for the reply , I tried but nothing seems to be happening ..
[oracle@node1 DEV]$ perl -pi -e 's/^INITIAL \d+/INITIAL 50k/' b.log
[oracle@inode1 DEV]$
[oracle@node1 DEV]$ perl -v
This is perl, v5.8.8 built for x86_64-linux-thread-multi
Copyright 1987-2006, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Thanks

Similar Messages

  • How do i make word open at 150% every time

    how do i make word open at 150% every time

    Since Word is a Microsoft product, ask in their forums.

  • How to replace a word on richtextbox

    hi
    how can i replace a word in one richtext box by code?
    like i have the richtexbox with the word TEST and i wanna to replace that word (TEST) by DONE for example

    how can i replace a word in one richtext box by code?
    Use the string Replace function with the rich text box Text property:
    RichTextBox1.Text = RichTextBox1.Text.Replace("TEST", "DONE")

  • How to replace a word thr shell script

    Hi,
    I need a shell script which should read a file(a.txt)
    and need to update the same file( means only replace a word with another one in the same file)
    my unix version is SunOS and i am using ksh
    could you pls provide me some better way.
    My failured trails are as below
    suppose a.txt file having data like,
    column1 column2 column3
    data1 data2 data3
    and my script is,
    #!/usr/bin/ksh
    patha=/tmp
    filea=a.txt
    sed '/column2/s//column4/g' $patha/$filea > $patha/$filea
    And also pls provide how to add data(data into new line) into file(a.txt)
    Thanks in advance.

    This is an Oracle SQL and PL/SQL forum.
    If you want to learn how to write unix shell scripts I suggest you search the internet for a suitable unix forum.

  • How to replace a word or line in a word document in CVI

    I am trying to edit a word document using activeX in CVI. I want to search for a word and replace it with another. I couldn't find any functions which does the replace in wordreport.c. Could you please help me out?

    Hi Isn,
    You
    will want to use the Microsoft Word 9.0 Object Library to interface
    with Microsoft Word.  You could then potentially be able to use the ActiveX calls
    provided to accomplish your goal.  The specifics on how to do this
    should be found in Microsoft's Documentation.
    Refer to the Microsoft document entitled How to find and use Office object model documentation. In your case, you will be looking at the Vbawrd9.chm help file which I believe will be located in the C:\Program Files\Microsoft Office\OFFICE\1033\ directory.
    Also refer to the Unable to Load Microsoft Excel/Word Help in LabWindows/CVI KnowledgeBase.
    Derrick S.
    Product Manager
    NI DIAdem
    National Instruments

  • How to replace first letters of a file name using Power shell or CMD

    Hi guys i am having a problem on mane files that i have which are duplicated. The main reason i cant group them by name is because they have numbers in front of their name which differs Eg
    01 - fileName.txt
    09 - fileName.txt
    02 - fileName.txt
    11 - fileName.txt
    i have a shed loads of them and would like to rename them by deleting the first three characters if they are numbers. I managed to create a powershell script to do that but the problem was that it would not work properly because the file would have a duplicated
    name after deleting the first few chars.
    can anyone help with a better script which would add a number to the end of the file name eg:
    fileName1.txt
    fileName2.txt
    fileName3.txt
    Ps all the files start with two numbers followed by a dash, however i have manually done a few which does not start with numbers and should be left alone by the script
    Thank you

    Here's a quick way to do it. I'm not sure what your existing code looks like but it sounds like you could incorporate this line into it.
    if ($oldfilename -match "[0-9]")
    $newfilename = $oldfilename.split("-")[1].trim().split(".")[0] + $oldfilename.split("-")[0].trim() + "." + $oldfilename.split("-")[1].trim().split(".")[1]
    else
    $newfilename = $oldfilename
    01 - fileName.txt becomes fileName01.txt
    fileName.txt stays fileName.txt

  • How to replace home folder after yosemite erase-reinstall?

    Hi, I did an erase-reinstall and then simply copied my backed-up home folder (administrator's home folder) back into the new home folder but this has not worked well. Can anyone tell me the correct procedure of how to restore the home folder. I have a Time Machine back-up from a previous online Yosemite install (not an erase-install) as well as a regular back-up on a separate drive. Can I fix this up (i.e. remove the whole current home folder and replace it properly) without doing another erase-install of yosemite? Many thanks, Barak

    baltwo, out of interest, I just found this at:  http://www.theinstructional.com/guides/how-to-re-run-the-os-x-setup-assistant
    How to Re-Run the OS X Setup Assistant
    Under certain circumstances, it can be advantageous to re-run the Setup Assistant. Using some command-line trickery, we can do just this without having to erase and reinstall OS X...
    Option?

  • How can the first syncing after launching Contribute be sped up?

    So a user brings up Contribute and it hangs there 2 or 3 minutes syncing.  Is there anyway to speed this process up?

    There has never been a facetime app on the iphone.
    As the manual says, you access from contacts.  Pick a contact and scroll down to the facetime button

  • How to connect to Database after succesfully configured IN-LINE Firewall

    Hi all,
    My database ip is: 192.168.1.100, listener 1521
    My bridge IP on Database Firewall is: 192.168.1.125
    I want to block drop statment. From client, what ip address will i connect to and what is connection string?
    Please help.
    Thank you!
    Dan.

    hi Dan,
    the firewall bridge must be physically located between the client network and the protected database, the only
    possible network path from the client to the database must be through the firewall bridge. You have the
    firewall apparently on the same subnet as the protected database, which is a requirement, so that part
    is ok, but you may need to check the wiring in your data center to check if the firewall is really inline.
    In a virtualized environment you must have the firewall bridge on the two NICs on different internal networks
    that form a connection between the client and the database, in essence this would not be different
    than real physical hosts,
    greetings,
    Harm ten Napel

  • Satallite A100: How to replace the keycaps?

    Is there a manual on how to replace the keycaps after they come off?
    My Satallite A100, one year old, lost two keycaps a few weeks ago, and I am unable to replace them, although I have all the (little) parts. It got even worse when some more came loose recently when my little son peeled some off, using the room created by the already missing keycaps.
    Thanks!

    Hello Mike
    Reading your posting I can not understand exactly what is wrong with your keyboard but removing and putting in place keycaps (plastic with written symbol) is not problematic. You must just put it right in place and gently press it down. You will hear click and the keycap will be in the place again.
    Under this keycap is placed small plastic mechanism. It contains two small plastic parts. If they are removed from the bottom you can put them inside again. To see how it looks like remove keycap from any other key and see how is it placed.
    I have done the same now and with a little bit patience you can put it in the right position again.

  • How can we read some bytes from every line of the file

    How can we read some bytes from the every line of the file moving on to the next line
    without using the read line

    Actualiy readLine() takes more execution time
    for reading a part of line if we can do so without
    readLine() we can save some time...Well, if you knew, beforehand, the length of each line, you could use RandomAccessFile and its seek method, but, since you don't, you would have to read the rest of the line character-by-character, checking to see if it is a newline, in order to place the "cursor" at the beginning of the next line in order to read the next few characters you want.
    So, as you can see, you will need to read the entire line anyway (and if you do it yourself you also have to do the checking yourself considering all three possible end-of-line sequences), so you just as well use readLine().
    Some people may suggest Scanner and it's nextLine() method, but that also needs to read the rest of line (as evidenced by the fact that it returns it), so that is no different than the readLine() (or read it yourself) solution.

  • How do I remove a space before the first word in a sentence using find and replace or GREP?

    Right, so I am laying out a document in inDesign from a word document and it has a space before every first word in a sentence. It is really annoying and I need a quick way to get rid of them. I wasn't too sure how to do it with find/change but I am sure there is a way in GREP if someone can help me. I have included an image so that people can see exactly what I mean.

    The ^ location works for all paragraphs.
    But a note to the OP, there is a sample script called FindChangeByList that removes leading and trailing spaces as well as extra spaces after punctuation, all in one go. But if you want to continue to use a GREP find/change to remove leading space, I'd modify Joel's suggestion to ^\s+ to get those cases where the user typed multiple spaces as well.
    And don't forget there are actually legitimate places for leading tabs, which both the script and this GREP will find and remove, so be careful.

  • How can I make iTunes sort on the first word by default, even though that word is "The" or "A"?

    How can I make iTunes sort on the first word by default, even though that word is "The" or "A"?
    I myself think that (for instance) "A tribe called Quest" should be sorted under "A", not "T".
    Now I can edit the sort options manually per track and/or per selection, but I would really like to just kill this "iTunes-knows-how-you-should-sort"-feature in iTunes.
    Anyone any suggestion on how to do that?
    Thanks

    Here is a modified version of one of Doug's Scripts. My modification was to add Sort Name to the list of tags that could be changed. I tried it on a single track and it worked. I recommend backing up your library first. Select the tracks you want to change (or all tracks) and run the script from the Applescript Editor.  If it works as intended, save it so you can apply it to newly imported tracks.  And, yes, I know this isn't the exact answer to your question, you want to change a preference setting in iTunes (if there is such a setting).
    Original script can be forund at http://dougscripts.com/itunes/scripts/ss.php?sp=thistagthattag
    Modified script is below. Start up Applescript Editor, paste it into a new window.  Start up iTunes and select the tracks to modify.  Click Run in the Applescript Editor.  Follow the instructions.
    (* Put This In That
    v2.0 april 22 2008
    - runs as universal binary
    - adds "Show" tag
    - consolidated code
    - saved as script bundle
    v1.7 October 3, 2006
    - adds "Album Artist" as option
    v1.6 October 28, 2004
    - works around iTunes 4.7 selection bug
    v1.5 ('04/1)-- adds "grouping" tag
    Get more free AppleScripts and info on writing your own
    at Doug's AppleScripts for iTunes
    http://dougscripts.com/itunes/
    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
    Get a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    or visit http://www.gnu.org/copyleft/gpl.html
    -- CONSTANTS
    property allOptions : {"Song Name", "Artist", "Album", "Album Artist", "Composer", "Genre", "Comments", "Show", "Grouping", "Sort Name"}
    property my_title : "Put This In That"
    global thisTag, thatTag, theNewTags, theOriginalTags, yn
    tell application "iTunes"
              if selection is not {} then -- if tracks are selected...
                        set sel to selection
                        set numTracks to (length of sel)
                        set s to "s"
                        if numTracks is 1 then set s to ""
                        display dialog "The data from one tag REPLACES the data in another tag in all the selected tracks, with option to delete data in first tag." & return & return & (numTracks & " track" & s & " selected.") buttons {"Cancel", "Continue"} default button 2 with title my_title giving up after 30
                        if gave up of result is true then return
                        my choose_this_tag()
                        my choose_that_tag()
                        set yn to (button returned of (display dialog "Delete data in " & thisTag & " afterwards?" buttons {"Yes", "No"} default button 2 with title my_title giving up after 45) is "Yes")
                        set oldfi to fixed indexing
                        set fixed indexing to true
                        repeat with t from 1 to numTracks
                                  tell contents of item t of sel
                                            set theOriginalTags to {get name, get artist, get album, get album artist, get composer, get genre, get comment, get show, get grouping, get sort name}
                                            set theNewTags to theOriginalTags
                                            my do_put()
                                            set {name, artist, album, album artist, composer, genre, comment, show, grouping, sort name} to theNewTags
                                  end tell
                        end repeat
                        set fixed indexing to oldfi
              else
      display dialog "No tracks have been selected." buttons {"Cancel"} default button 1 with icon 0 giving up after 30
              end if -- no selection
    end tell
    to choose_this_tag()
              tell application "iTunes"
                        set n to (choose from list allOptions with prompt ("Select a tag to get data from:") with title my_title)
                        if n is false then error number -128
                        set thisTag to (n as text)
              end tell
    end choose_this_tag
    to choose_that_tag()
              set o to {}
              repeat with t in allOptions
                        if (t as text) is not thisTag then copy t to end of o
              end repeat
              tell application "iTunes"
                        set n to choose from list o with prompt ("Use data from the " & thisTag & " tag to REPLACE data in...") with title my_title
                        if n is false then error number -128
                        set thatTag to n as text
              end tell
    end choose_that_tag
    to do_put()
              try
                        repeat with i from 1 to (length of allOptions)
                                  if thisTag is (item i of allOptions) then
                                            set thisTag_sto to (item i of theOriginalTags)
                                            exit repeat
                                  end if
                        end repeat
                        repeat with i from 1 to (length of allOptions)
                                  if thatTag is (item i of allOptions) then
                                            set (item i of theNewTags) to thisTag_sto
                                            exit repeat
                                  end if
                        end repeat
                        if yn then
                                  repeat with i from 1 to (length of allOptions)
                                            if thisTag is (item i of allOptions) then
                                                      set (item i of theNewTags) to ""
                                                      exit repeat
                                            end if
                                  end repeat
                        end if
              end try
    end do_put

  • How do I find and replace a word in PDF?

    How do I find and replace a word in PDF?

    In the Find window (Ctrl+F) there's an option to replace the searched text.
    This is in Acrobat XI, and there's no Replace All-function.
    On Thu, Jan 15, 2015 at 4:27 PM, claireb88184899 <[email protected]>

  • Last night I downloaded the latest Word update. Today the first Word document crashed and I lost 45 minutes of work in spite of having saved the document numerous times. Why is Word crashing the day after a safety update? I have Office 2008 for Mac

    Last night I downloaded the latest Word update. Today the first Word document crashed and I lost 45 minutes of work in spite of having saved the document numerous times. Why is Word crashing the day after a safety update? I have Office 2008 for Mac

    One way to test is to Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, Test for problem in Safe Mode...
    PS. Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive
    Reboot, test again.
    If it only does it in Regular Boot, then it could be some hardware problem like Video card, (Quartz is turned off in Safe Mode), or Airport, or 3rd party add-on, Check System Preferences>Accounts>Login Items window to see if it or something relevant is listed.
    Check the System Preferences>Other Row, for 3rd party Pref Panes.
    Also look in these if they exist, some are invisible...
    /private/var/run/StartupItems
    /Library/StartupItems
    /System/Library/StartupItems
    /System/Library/LaunchDaemons
    /Library/LaunchDaemons
    Open Console in Applications>Utilities, check the system log for the date/time of the last problem  & next startup for clues.

Maybe you are looking for