LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

probleme lecture fichier ini volumineux

Bonjour, je souhaite convertir des fichiers d'acquisition au format ini (section +clé) assez volumineux. Le problème est le bloquage de Labview à l'ouverture du fichier qui n'aboutie pas(Test ok en allégeant le fichier) . Existe t-il une librairie OpenG ? Si oui où là télécherger ?

 

Merci

 

Ludo

0 Kudos
Message 1 of 17
(2,756 Views)

Bonjour Ludo,

 

Si je comprends bien, l'acquisition se déroule bien (dans quel format ?) mais c'est une fois le fichier obtenu converti en .ini (de quelle manière ?) que LabVIEW refuse de l'ouvrir (version de LV ? code d'erreur ? à partir de quel volume de données?).

 

Merci de votre retour,

0 Kudos
Message 2 of 17
(2,726 Views)

Bonjour, l'acquisition est faite au format de stockage type ini, il y 4 sections dont la dernière comprend les mesures (10 colonnes sur 72000 lignes).J'ai relancer l'ouverture du ficher sous labview et au bout de 13 min il a réussi à l'ouvrir. Celà est vraiment long par rapport a Wordpad où l'ouverture est quasi instantané. Je souhaiterai savoir si une bibliothèque plus efficace en openG existait ?

 

Ludo

0 Kudos
Message 3 of 17
(2,721 Views)

En effet 13 minutes pour 72 000 lignes me semble beaucoup.

 

Serait-ce possible de pouvoir jeter un oeil au code et au fichier ? (et la version de LabVIEW utilisée ?)

 

Merci,

 

0 Kudos
Message 4 of 17
(2,719 Views)

How are you opening the file in LabVIEW? If you use the config file functions, then yes, it will take a long time to parse. If you open as a text file (which is what wordpad does - no parsing) then it will open quickly, but you will have to parse the sections and keys yourself.

 

An INI file is not generally considered a good way to store data, it's used mostly to store configuration information. Consider using TDMS.

Message 5 of 17
(2,711 Views)

Hi, i change data storage in hdf5 format but for older data i want to copy them in hdf5 file. So i would like to read more faster ini file. Do you know a library for read ini file faster ?

 

Ludo 

0 Kudos
Message 6 of 17
(2,704 Views)

If you want to copy your INI files to HDF5, the fastest way to do it is to handle your INI files as a text file and process them yourself at low level.  Since an INI file has a very strict hierarchy, this is relatively simple.  Try the following:

 

  1. Open the INI file as a text file.
  2. Initialize a 65000 character buffer.
  3. Read 65000 characters from the INI file into the buffer.
  4. Search for an End Of Line character (this could be \r, \n, \r\n, or \n\r, you can find out easily by looking at your first buffer with the codes view turned on)
  5. Process this line.  For section headers, this may mean creating a group in your HDF5 file.  For data, it could me adding to a buffer to write to the HDF5 file as a dataset or attribute.  You will need to create these extra buffers as needed.  It is much faster to create a buffer, then write into it than to append to an array.
  6. Repeat steps 4 and 5 until you do not find an End Of Line.
  7. Copy the line fragment from the end of the buffer to the beginning.
  8. Read enough data from the INI file to fill from the end of the line fragment to the end of the buffer.
  9. Repeat this process until you hit the end of the file.  Given the size of your files (72000 lines), it should take about a minute for the entire process, depending upon how good your computer is.

Good luck.

 

0 Kudos
Message 7 of 17
(2,701 Views)

Hi, i read my ini file with labview 8.2. A few second for return sections between 13 mins for labview 2012. So I should expect to find a library and just use it. But I didn'i find that. Somebody can help me ?

 

Ludo

0 Kudos
Message 8 of 17
(2,677 Views)

That's odd.  I thought that problem had been fixed.  Awhile back, the INI file code was refactored so it would handle unicode character strings correctly.  During the refactor, a major performance bug slipped in unnoticed, but I though it had been fixed.  Could you zip your file and post it so I can write a corrective action report on the issue?  This may be something new.

 

In any case, using the algorithm I listed above will still work well.  Do not use the configuration file VIs.  Use the basic file I/O primitives.

0 Kudos
Message 9 of 17
(2,665 Views)

This is the files

0 Kudos
Message 10 of 17
(2,652 Views)