vbgunz, I wrote the following (using Afrow UK's Read from text file line number function), and tested it on a text file (text.txt) that consisted of 800 lines of:
00020201070010102010101010202 SHEEP and 7 WOLVES
00020201070010102010101010202 SHEEP and 7 WOLVES
00020201070010102010101010202 SHEEP and 7 WOLVES
00020201070010102010101010202 SHEEP and 7 WOLVES
etc...
It created a new text file called text1.txt in 15 seconds consisting of 800 lines of:
7 SHEEP and 7 WOLVES
7 SHEEP and 7 WOLVES
7 SHEEP and 7 WOLVES
etc...
Once you have the new text file (text1.txt) you can copy it back over you original, or do with it as you please. Here is the code. Note you should only have to change the text file names and the end number (801). Hope this helps.
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
OutFile "Setup.exe"
ShowInstDetails show
Section "MainSection" SEC01
StrCpy $1 0
Loop:
Intop $1 $1 + 1 ;Sets line number to be read below
StrCmp $1 801 End
Push $1 ;line number to read from
Push "text.txt" ;text file to read
Call ReadFileLine
Pop $0 ;output string (read from file.txt)
StrCpy $2 $0 "" 9 ;sets $2 = line $1 minus first 9 characters
StrCpy $3 $2 1 ;sets $3 to first character of $2
StrCpy $4 $2 "" 20 ;sets $4 = line $1 minus everything before character 30
FileOpen $5 Text1.txt a
FileSeek $5 0 END
FileWrite $5 $3
FileWrite $5 $4
FileClose $5
Goto Loop
End:
SectionEnd
Function ReadFileLine
Exch $0 ;file
Exch
Exch $1 ;line number
Push $2
Push $3
FileOpen $2 $0 r
StrCpy $3 0
Loop:
IntOp $3 $3 + 1
ClearErrors
FileRead $2 $0
IfErrors +2
StrCmp $3 $1 0 loop
FileClose $2
Pop $3
Pop $2
Pop $1
Exch $0
FunctionEnd