Hi, I need script / program / code or whatever which can export part of log file (.ini) to another one Some Useless Thing Some Useless Thing direct="i need export this" Some Useless Thing Some Useless Thing Googled it several hours with no luck, hope some of you could help Any suggestion appreciated
Let me suggest using AutoIt. You'll use the IniRead function to accomplish this task. Code: Local $text = IniRead ( "filename", "section", "key", "default" ) ; "default" is the value the function should return if your key doesn't exist MsgBox(0, "Value", $text) ; show a message box with the value
Unfortunetly I'm not good friend with auto it.. But thanks for your advice anyway Someone have other idea?
Heres a simple example to retrieve certain string from file and write it to another in VB.NET: Code: ' Read lines in file: C:\log.ini Dim lines As String() = File.ReadAllLines("C:\log.ini") ' Get certain text (first line is not read, string on line 3 will be line 2) Dim read As String = lines(2) 'Create log2.ini Using sw As New StreamWriter("C:\log2.ini") ' Write text you want to C:\log2.ini sw.WriteLine(read.Substring(8, 18)) sw.Close() End Using
I do not even know how to use it.. tried ask google but it's "black magic" for me.. But thanks for trying to helping me anyway I thought it could be possible using batch or some already exsiting app Well.. coming back to CTRL+C > CTRL+V
he's is using vb.net all u would have to do is create a vb.net project copy and past the code and debug or compile to get your result. of coarse changing the code to point to the correct paths
Name_Of.ini Code: Some Useless Thing Some Useless Thing direct="i need export this" Some Useless Thing Some Useless Thing Read_and_Export.cmd Code: @echo off for /f "tokens=1,2 delims==" %%a in (Name_Of.ini) do ( if %%a==direct set direct=%%b ) echo %direct% >export.ini