PDA

View Full Version : Process Text Files



mario.capin
08-19-2015, 09:17 AM
Hi Friedrich,

how can I process text files within SB scripts (e.g. I want to know how many rows a text file has)?
Are there any advanced string functions in this context (e.g. I want to process a part of a text file)?

Best regards,
Mario

linder
08-20-2015, 02:21 AM
Mario,

You can use the "Handle Text File Operation" function in SetupBuilder to edit text files in various ways or to retrieve text file information.

Does this help?

Friedrich

mario.capin
08-20-2015, 02:38 AM
Friedrich,

thank you, everything is clear now.

Mario

linder
08-20-2015, 03:07 AM
Perfect! Thanks for the update, Mario.

Friedrich

mario.capin
08-20-2015, 05:05 AM
Hi,

I want to proof if crystal report modules installation has successfully finished. I know if not, there will be written a lof file in kind of this:

=== Logging started: 21.07.2015 23:07:56 ===
Error 1904. Module C:\Program Files\Business Objects\BusinessObjects Enterprise 11\win32_x86\plugins\auth\secLDAP\secldap.dll failed to register. HRESULT -2147024770. Contact your support personnel.
=== Logging stopped: 21.07.2015 23:08:30 ===

On successful installation:

=== Logging started: 21.07.2015 23:07:56 ===
=== Logging stopped: 21.07.2015 23:08:30 ===

My solution strategy:

Set Variable %_UD_CR_LOG_FILE% to "%_SB_INSTALLDIR%\crystal.log"
Run Program [_UD_UPDATES_PATH]\CrystalReportModules.exe /passive /le "%_UD_CR_LOG_FILE%" (Always Install) [Wait]
! Handle Crystal Reports Installation Fail
Set Variable %_UD_CR_LOG_LINE_NUMBERS% to FUNCTION:Count Lines from "%_UD_CR_LOG_FILE%"
Set Variable %_UD_CR_LOG_LINE2% to FUNCTION:Get Line "2" from "%_UD_CR_LOG_FILE%"
If %_UD_CR_LOG_LINE_NUMBERS% Greater Than "2" Then
Display Message Box "This setup will instal the demo version of %_UD_PR..." -- "Crystal Reports Installation Fail"
Exit Installation()
Else
Display Message Box "%_UD_CR_LOG_FILE%\n%_UD_CR_LOG_LINE_NUMBERS%\n%_UD ..." -- "Crystal Reports installation succeed"
End

My first problem is, that the count-lines-function deliveres 1?! If I display the first line (here 3rd one in following message box) on crystal reports installation success by message box there will be shown cryptic signs:

3893

What's wrong?

Thank you,
Mario

linder
08-21-2015, 02:25 AM
Mario,

Perhaps it is an non-ASCII file or it does not end with an CR/LF.

If you are interested, please ZIP up that file and send it to support [at] lindersoft [dot] com. We'll then review your crystal.log file.

Friedrich