How to merge two text files? and sort them...
#141
Posted 24 November 2011 - 12:57 PM
#142
Posted 24 November 2011 - 01:36 PM
tomasz86, on 24 November 2011 - 10:27 AM, said:
Yeah, life is tough.
Read again the lines with |FIND /V ....
This:
IF %Counter%.==0. ECHO.&ECHO There are no new files to add.
IF NOT %Counter%.==0. (
ECHO.&ECHO Repacking fp40ext.cab...
CABARC N %SP6%\fp40ext.cab TEMP\fp40extcab\*.* >NUL
)
makes no sense
jaclaz
#143
Posted 24 November 2011 - 07:50 PM
Yzöwl said:
jaclaz said:
Read again the lines with |FIND /V ....
But this would make the script system locale dependent which I would like to avoid
#144
Posted 24 November 2011 - 11:11 PM
n is never going to be anything other than n in any language
Additionally, you cannot call something non language dependent which outputs English statements:
Quote
file(s) were added.
There are no new files to add.
Repacking
#145
Posted 25 November 2011 - 12:03 AM
I'll try to use the temp folder method.
#146
Posted 25 November 2011 - 03:35 AM
Get STRARC:
http://www.ltr-data.se/opencode.html/
http://www.ltr-data....iles/strarc.txt
it's messages will be English allright AND you will have a "better" file copy utility.
jaclaz
#147
Posted 25 November 2011 - 11:20 AM
Please also note that user locales would take precedence over system locales so technically you would want the script to be non user locale dependent.
#148
Posted 26 November 2011 - 12:48 AM
My comment about locales was related only to this part of your message and wasn't intended to be sarcastic at all.
Yzöwl said:
Quote
file(s) were added.
There are no new files to add.
Repacking
I haven't got time yet to try the method you suggested and yes, I'm a beginner when it comes to batch scripting so I don't understand many of your script suggestions until I try to use them in practice. Please don't look for bad intentions everywhere!
#149
Posted 06 March 2012 - 05:08 AM
I have a big problem with splitinf. When I use it on this inf file:
update.inf
some entries are not present in the final file (and in SPLIT_update folder too), ex. the [System32.Files] section comes out empty although it's not empty in the original update.inf.
BEAUTY_JOINED_update.inf
This post has been edited by tomasz86: 06 March 2012 - 05:15 AM
#150
Posted 06 March 2012 - 05:48 AM
tomasz86, on 06 March 2012 - 05:08 AM, said:
I have a big problem with splitinf. When I use it on this inf file:
update.inf
some entries are not present in the final file (and in SPLIT_update folder too), ex. the [System32.Files] section comes out empty although it's not empty in the original update.inf.
BEAUTY_JOINED_update.inf
That's probably pretty much "normal".
That file has duplicate [System32.Files] entries, second one empty.
I seem to remember that entries need to be deduplicated first.
jaclaz
#151
Posted 06 March 2012 - 06:11 AM
This post has been edited by tomasz86: 06 March 2012 - 06:12 AM
#152
Posted 06 March 2012 - 06:11 AM
update.inf
BEAUTY_JOINED_update.inf
The script isn't case sensitive, is it?? It's [System32.files] vs [System32.Files] here.
@EDIT
It is case sensitive
@EDIT2
I'm just kind of guessing but maybe
IF /I "%%?"=="%Section%" SET dupe_Flag=1
instead of
IF "%%?"=="%Section%" SET dupe_Flag=1?
This post has been edited by tomasz86: 06 March 2012 - 06:26 AM
#153
Posted 06 March 2012 - 07:51 AM
#154
Posted 28 March 2012 - 12:32 AM
1. splitinf.cmd
Before:
::Replace "==" with a dummy string "§#§" CALL :run_gsar :x3d:x3d :xa7:x23:xa7
After:
::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:xa7
2. beautify.cmd
Before:
::Replace dummy string "§#§" with "==" CALL :run_gsar :xa7:x23:xa7 :x3d:x3d
After:
::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:x3d
so now not only "==" but also ">=" & "<=" are processed correctly.
#155
Posted 28 March 2012 - 01:33 AM
Cheers and Regards
#156
Posted 28 March 2012 - 05:03 AM
#157
Posted 20 April 2012 - 04:34 AM
::Replace even more stoopid "|" with a dummy string "§#########§" CALL :run_gsar :x7c :xa7:x23:x23:x23:x23:x23:x23:x23:x23:x23:xa7
and 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 :x7c
because 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.
This post has been edited by tomasz86: 20 April 2012 - 04:35 AM
#158
Posted 21 April 2012 - 06:40 AM
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.
This post has been edited by tomasz86: 21 April 2012 - 06:41 AM
#159
Posted 21 April 2012 - 10:05 AM
type file| sed ":a;N;$!ba;s/=\\\n\ /=/g"
#160
Posted 21 April 2012 - 01:00 PM
tomasz86, on 20 April 2012 - 04:34 AM, said:
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:
Quote
"sth1"
is most probably a =\CR+LF" sequence. If yes, you can use gsar allright.
jaclaz
- ← Copying single file from USB/network drive to multiple folders on C:
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- Find actual total physical memory →



Help

Back to top










