Jump to content

Recommended Posts

Posted (edited)

I have some large file which I have to read to AutoIt to make some checking but reading same file again and again take a lot of time. I was wondering if I can save that file in some other way to read it in Autoit faster? It's report (text file) with tab character column separator. Maybe I can save it in RAM or something?

Any idea?

Edited by maniootek
Posted
  On 6/7/2021 at 11:40 AM, Danp2 said:

There aren't many details in your request. How are you currently reading the file? Have you looked into using FileReadToArray or _FileReadToArray?

Expand  

My code use FileRead, StringSplit and some loop to convert file to array but I just tried _FileReadToArray and it's very fast. Instead of 60sec I wait now about 1-2 sec. That is incredible change! Thank you very much!

  • 2 weeks later...
  • Developers
Posted
  On 6/22/2021 at 11:31 AM, maniootek said:

I don't see any function to read json from file

Expand  

And what exactly is the issue with that or do you really need help how to read the whole file content into a variable in Autoit3?

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

It is all about speed. I am wondering if I can load data from file into AutoIt array with same fast way as function _FileReadToArray() do but with json file.

Local $hFileOpen = FileOpen($sFilePath)
Local $sJson_FileRead = FileRead($hFileOpen)

Local $oJson_Orders = Json_Decode($sJson_FileRead)
Local $a_oJson_Orders = Json_ObjGet($oJson_Orders, "orders")

 

Posted

I'm working on JSON anonymizer.
It may took me few days, as I'm busy at other projects in my work.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 6/22/2021 at 1:01 PM, maniootek said:

It is all about speed. I am wondering if I can load data from file into AutoIt array with same fast way as function _FileReadToArray() do but with json file.

Local $hFileOpen = FileOpen($sFilePath)
Local $sJson_FileRead = FileRead($hFileOpen)

Local $oJson_Orders = Json_Decode($sJson_FileRead)
Local $a_oJson_Orders = Json_ObjGet($oJson_Orders, "orders")

 

Expand  

But what do you then expect?

see 

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...