tomasz86 Posted March 6, 2012 Author Share Posted March 6, 2012 (edited) double post Edited March 6, 2012 by tomasz86 Link to comment Share on other sites More sharing options...
tomasz86 Posted March 6, 2012 Author Share Posted March 6, 2012 (edited) Hmm, I'm not sure if that's the case. I've never experienced this problem before. In this case the first [system32.Files] seems to be ignored. I added "abc" to the second [system32.files] so now the two should be merged (as it's in case of other sections) but in the final file only "abc" is present under [system32.Files].update.infBEAUTY_JOINED_update.infThe script isn't case sensitive, is it?? It's [system32.files] vs [system32.Files] here.@EDITIt is case sensitive Is there any simple way to make it case insensitive?@EDIT2I'm just kind of guessing but maybeIF /I "%%?"=="%Section%" SET dupe_Flag=1instead of IF "%%?"=="%Section%" SET dupe_Flag=1? Edited March 6, 2012 by tomasz86 Link to comment Share on other sites More sharing options...
jaclaz Posted March 6, 2012 Share Posted March 6, 2012 I'm just kind of guessing but maybeIF /I "%%?"=="%Section%" SET dupe_Flag=1instead of IF "%%?"=="%Section%" SET dupe_Flag=1?A very educated guess jaclaz Link to comment Share on other sites More sharing options...
tomasz86 Posted March 28, 2012 Author Share Posted March 28, 2012 By the way, I added these lines to splitinf.cmd and beautify.cmd:1. splitinf.cmdBefore:::Replace "==" with a dummy string "§#§"CALL :run_gsar :x3d:x3d :xa7:x23:xa7After:::Replace "==" with a dummy string "§#§"CALL :run_gsar :x3d:x3d :xa7:x23:xa7::Replace even more stoopid ">=" with a dummy string "§#######§"CALL :run_gsar :x3E:x3d :xa7:x23:x23:x23:x23:x23:x23:x23:xa7::Replace even more stoopid "<=" with a dummy string "§########§"CALL :run_gsar :x3C:x3d :xa7:x23:x23:x23:x23:x23:x23:x23:x23:xa72. beautify.cmdBefore:::Replace dummy string "§#§" with "=="CALL :run_gsar :xa7:x23:xa7 :x3d:x3dAfter:::Replace dummy string "§#§" with "=="CALL :run_gsar :xa7:x23:xa7 :x3d:x3d::Replace a dummy string "§#######§" with even more stoopid ">="CALL :run_gsar :xa7:x23:x23:x23:x23:x23:x23:x23:xa7 :x3E:x3d::Replace a dummy string "§########§" with even more stoopid "<="CALL :run_gsar :xa7:x23:x23:x23:x23:x23:x23:x23:x23:xa7 :x3C:x3dso now not only "==" but also ">=" & "<=" are processed correctly. Link to comment Share on other sites More sharing options...
bphlpt Posted March 28, 2012 Share Posted March 28, 2012 After all the work you've done with these various tools you've used and modified, would you please post all the current scripts/tools you use with a very brief description of how you use them, or are they all already conveniently available in one place?Cheers and Regards Link to comment Share on other sites More sharing options...
tomasz86 Posted March 28, 2012 Author Share Posted March 28, 2012 No problem but I'd like to finish the script first. At this moment it still needs many fixes and addtions to be fully functional, especially concerning the SP part (merging updates works more or less). There are some issues with it too which I must fix before making it public, ex. the script now works in Windows 2000 only and doesn't in other versions of Windows, not even in XP. Link to comment Share on other sites More sharing options...
tomasz86 Posted April 20, 2012 Author Share Posted April 20, 2012 (edited) I added one more lines to splitinf.cmd:::Replace even more stoopid "|" with a dummy string "§#########§"CALL :run_gsar :x7c :xa7:x23:x23:x23:x23:x23:x23:x23:x23:x23:xa7and one to beautify.cmd:::Replace a dummy string "§#########§" with even more stoopid "|" CALL :run_gsar :xa7:x23:x23:x23:x23:x23:x23:x23:x23:x23:xa7 :x7cbecause some lines with "|" simply disappeared after running splitinf.cmd.By the way, jaclaz, is there any particular reason to use the "§" character and not any other one? It gets "butchered" when system locale is set to some languages (Chinese, Korean, Japanese for sure) and therefore the final output is not correct. Edited April 20, 2012 by tomasz86 Link to comment Share on other sites More sharing options...
tomasz86 Posted April 21, 2012 Author Share Posted April 21, 2012 (edited) Has anyone got any idea how to process such lines automatically:ELK_LOCALE_INUSE_201a=\ "sth1"ELK_MUI_INUSE_046e=\ "sth2"and get this:ELK_LOCALE_INUSE_201a="sth1"ELK_MUI_INUSE_046e="sth2"? I've tried many different ways but can't get through it :/ I guess my commandline knowledge is too limited... There are different lines inbetween too. Edited April 21, 2012 by tomasz86 Link to comment Share on other sites More sharing options...
allen2 Posted April 21, 2012 Share Posted April 21, 2012 This should do it (sed.exe is needed and is a port of gnu sed from the unix tools) :type file| sed ":a;N;$!ba;s/=\\\n\ /=/g" Link to comment Share on other sites More sharing options...
jaclaz Posted April 21, 2012 Share Posted April 21, 2012 By the way, jaclaz, is there any particular reason to use the "§" character and not any other one? It gets "butchered" when system locale is set to some languages (Chinese, Korean, Japanese for sure) and therefore the final output is not correct.You find another "rarely" used character and it will do.I have it (the §) on my keyboard, so I tend to use it.Though I cannot see how it can become "butchered", as it is simply an intermediate step, and it is "added" bu a batch and "removed" by the next. In any case the idea of §<n*#>§ is simply that of having an "unlikely to be present in a .inf/.ini/.sif" string for substitution, to reèplace characters that are not parsable by a batch.The:ELK_LOCALE_INUSE_201a=\ "sth1"is most probably a =\CR+LF" sequence. If yes, you can use gsar allright.jaclaz Link to comment Share on other sites More sharing options...
tomasz86 Posted April 23, 2012 Author Share Posted April 23, 2012 (edited) I think the problem with "§" is that when I set system locale to Korean and then run the script something like "==" becomes "??" instead of "§#§" so the beautify.cmd part cannot work properly.The "§" seems to be processed incorrectly by cmd.exe for certain system locales. There's no problem when I set it to Polish. Edited April 23, 2012 by tomasz86 Link to comment Share on other sites More sharing options...
jaclaz Posted April 23, 2012 Share Posted April 23, 2012 I think the problem with "§" is that when I set system locale to Korean and then run the script something like "==" becomes "??" instead of "§#§" so the beautify.cmd part cannot work properly.The "§" seems to be processed incorrectly by cmd.exe for certain system locales. There's no problem when I set it to Polish.It must be something connected to Codepage (or NLS, or *whatever*) .You can try using instead of the "§" an "unlikely to be used character within the first 127 ASCII:http://www.asciitable.com/A good candidate (actually two of them could be "{" and "}" (with the side effect of looking more nice)jaclaz Link to comment Share on other sites More sharing options...
tomasz86 Posted April 24, 2012 Author Share Posted April 24, 2012 (edited) It's not codepage because I tried to set it manually in cmd.exe (CHCP command) but the effect was still the same. I've replaced all "xa7" with "x7b" ("{") and it seems to work OK now. Thank you EDIT: I also had to change the lineECHO §mod by jaclaz>%Work%toECHO {mod by jaclaz>%Work%in join_dedupe.inf.cmd. Edited April 24, 2012 by tomasz86 Link to comment Share on other sites More sharing options...
tomasz86 Posted May 22, 2012 Author Share Posted May 22, 2012 The:ELK_LOCALE_INUSE_201a=\ "sth1"is most probably a =\CR+LF" sequence. If yes, you can use gsar allright.I didn't know how to do it with gsar so I've prepared this script:@ECHO OFFSETLOCAL ENABLEDELAYEDEXPANSIONFOR /F "tokens=* delims=*" %%I IN ([Strings]update.inf) DO ( SET STRING= FOR /F "tokens=2 delims==" %%J IN ("%%I") DO ( IF "%%J"=="\" ( SET STRING=1 FOR /F "tokens=1 delims==" %%K IN ("%%I") DO ( SET STRING1=%%K ) ) ) IF NOT DEFINED STRING IF DEFINED STRING1 ( SET STRING2=%%I ECHO>>[Strings]update.inf.temp !STRING1!=!STRING2:~1! SET STRING1= ) ELSE ( ECHO>>[Strings]update.inf.temp %%I )) Link to comment Share on other sites More sharing options...
jaclaz Posted May 22, 2012 Share Posted May 22, 2012 I didn't know how to do it with gsar so I've prepared this script:Yep, but why making it more complex than needed?gsar is already among the used tools if I remember correctly, and it's usage is pretty much simple:rem change "\CR+LF" to "SPACE"gsar -o "-s:x5C:x0D:x0A" "-r:x20" "filename"should do.jaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now