Results 1 to 4 of 4

Thread: Search and Replace

  1. #1
    Variable Bitrate chevyn8's Avatar
    Join Date
    Oct 2006
    Location
    small town nebraska
    Posts
    263

    Search and Replace

    Just a simple search and replace. Was developed for button changing...found a better way to do that...so I modified the code to do a universal search and replace within a file. This script is a byproduct of a different script. Someone may find it useful:

    The original idea is that you can change anything in an INC file, without messing with the rest of the file. A skin could have one INC file, something like settings.txt, with all the settings in it, and make changes to a single item. Works like this:
    Start the script run;path to sr.exe
    Setvar's SROLD SRNEW SRFILETOEDIT SRTEXTORLINE
    Script will then edit the file
    SRTEXTORLINE:
    TEXT will search for specific text and replace just that text.
    search for /DEFINE fontsizemk1 "18" , replace with /DEFINE fontsizemk1 "22"

    LINE will search for specific text and replace the whole line.
    search for fontsizemk1, replace with /DEFINE fontsizemk1 "22"--better because you may not know the old font size or whatever value you are replacing.

    This will also work on .skin files... you could replace an INC line to include a different file to change the look of a skin.
    Located here: SR
    CarPC in my 82 Camaro. Dual core atom, M4-ATX, 7 lilliput, bu353 GPS, Reborn skin, punch 40/100ix
    MediaLaunch for RR
    Online Check for RR
    Locker for RR

  2. #2
    Maximum Bitrate Dalailama's Avatar
    Join Date
    Jan 2006
    Location
    Novara Italy
    Posts
    628
    It seems just what I was looking for!!!
    ..is it possible to use it to change some line in skin.ini without changing the others too?
    ...or does it work just with INC .txt file?

    Edited--------
    I jumped the line:
    This will also work on .skin files... you could replace an INC line to include a different file to change the look of a skin.


    how can I do if I want to search and replace a string like this:
    B20[HL],[/HL]120[HL],[/HL]100[HL],[/HL]315[HL],[/HL]70[HL],[/HL]"SKIN"[HL],[/HL]"skin browser"
    ??
    Live today like it is your last day, and behave as though you will live forever...

    my WEBSITE

    MapMonkey Dalai skin-preview-download ITA-email me for ENG
    Road Runner CrystalBlue skin-preview-beta release

  3. #3
    Variable Bitrate chevyn8's Avatar
    Join Date
    Oct 2006
    Location
    small town nebraska
    Posts
    263
    I found an old post from guino on the comma issue..... define comma in skin.ini:
    cm=,
    Then use $cm$ in place of the comma.
    Example from MKIII exectbl.ini (not in that skin, just the version I have)
    "MENURED","RUN;$skinpath$\sr.exe||setvar;srold;men u_OFF||setvar;srnew;menu_OFFred.png$CM$menu_OFFred .png$CM$menu_On.png$CM$menu_OFFred.png||setvar;srf iletoedit;menu.skin||setvar;srtextorline;line||wai t;2||reloadskin"

    It changes the images the skin uses
    skin.ini contains cm=,

    If B20 is unique to that line, you should be able to search for B20 and replace with your line.
    CarPC in my 82 Camaro. Dual core atom, M4-ATX, 7 lilliput, bu353 GPS, Reborn skin, punch 40/100ix
    MediaLaunch for RR
    Online Check for RR
    Locker for RR

  4. #4
    THE EXPERIMENTER
    Auto Apps:loading...
    carputer1's Avatar
    Join Date
    Sep 2007
    Location
    UK,Surrey
    Posts
    1,978
    looking for a little help please.

    i have this working via useing OSK to define the changes. but i can not get it to write
    || it will only write whats before it, not the || and whats after it.

    i open OSK type SILABS||Silabs, ENTER , Script runs, Result = SILABS

    any ideas guys, i did try $CM$=|| in the skin.ini but that did'nt work,may have that bit wrong in the code below,

    1st code without $CM$

    "NEWBUTTONIS"," ||OSKTOCMD;NEWBUTTON;ADDBUTTON"
    "ADDBUTTON","RUN;$skinpath$\sr.exe||setvar;srold;$ REPLACE$||setvar;srnew;$NEWBUTTON$||setvar;srfilet oedit;buttonlist.txt||setvar;srtextorline;line||AD DTOFILE;$SKINPATH$buttonlist.txt;=$REPLACE$"

    2nd code with $CM$

    "NEWBUTTONIS"," ||OSKTOCMD;NEWBUTTON;ADDBUTTON"
    "ADDBUTTON","RUN;$skinpath$\sr.exe||setvar;srold;$ REPLACE$||setvar;srnew;$NEWBUTTON$$CM$$NEWBUTTON$| |setvar;srfiletoedit;buttonlist.txt||setvar;srtext orline;line||ADDTOFILE;$SKINPATH$buttonlist.txt;=$ REPLACE$"


    Thanks

    ENJOY
    Riderunner / Genesis
    Plugin Breaker in test BassRR Plugin Player, Wifiman_NET
    New Home for Genesis & BassRR :adding to site ,, Hellfyre night
    Bassrr Beta Release :Version 1.3.7
    Movie_info Release :Version 3.1.0
    Wifiman_NET:Version 1.0.0

    Every Future, Needs A Beginning

Similar Threads

  1. Digital FX 2.0 Transparent Released
    By JohnWPB in forum RR Skins No Longer Supported
    Replies: 3759
    Last Post: 03-07-2008, 12:23 PM
  2. New Ratings Plugin - based on a ratings database
    By Blue ZX3 in forum RR Plugins
    Replies: 42
    Last Post: 01-26-2008, 01:41 PM
  3. XP wont search
    By lez in forum Off Topic
    Replies: 0
    Last Post: 11-13-2005, 02:45 AM
  4. I know nuuuuthing............
    By dzrtram in forum Newbie
    Replies: 34
    Last Post: 06-14-2005, 03:38 PM
  5. Pioneer 2460 Replace CD function with AUX?
    By captain caveman in forum Car Audio
    Replies: 5
    Last Post: 02-12-2005, 12:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •