FlexPro
HistoryBase
Ingénierie
Formation
Téléchargements
Assistance FlexPro
Connaissance
Communauté
À propos de nous
Références
Emplois
Contact général
Liste des revendeurs
Assistance FlexPro
FR
DE
EN
Porte-plaquette
Produits et solutions
Support et téléchargements
Entreprise
Magazine
Contact
Langue
MyWeisang

Paramètres du compte.

Topic

ReadTextFile durch ReadTextData ersetzen

Page d'accueil ' Communauté ' Généralités ' Remplacer ReadTextFile par ReadTextData

Étiqueté : 

Voir les messages de 2 - 1 à 2 (sur un total de 2)
  • Auteur
    Messages
  • #34721
    Anonyme
    Inactif

    Hallo,

    ich habe mir neulich die aktuellste FlexPro Version installiert. Mir ist dann aufgefallen, dass die Funktion ReadTextFile veraltet und durch ReadTextData zu ersetzen ist. Leider fehlen mir Beispiele, wie das genau gemacht werden kann. Es geht prinzipiell um ein spaltenweises Ablesen einer CSV-Datei. Wie kann ich beispielsweise folgende Formel mit einer ReadTextData Formel schreiben:

    ReadTextFile(“C:\tmp\test.csv”, 4n, 0n, 5n, 5n, FALSE, TYPE_FLOATINGPOINT64, FALSE, “;”, TRUE)

    Also wie kann ich aus der Datei “C:tmptest.csv” die 5. Spalte und ab der 4. Zeile meine Daten mit der Formel ReadTextData importieren? Vielen Dank im Voraus

    #34722
    Adrian Giurca
    Maître des clés

    You can still use the ReadTextFile even if it is deprecated.

    Remark from ReadTextData Help:

    If a file is imported using the Text Data Import Wizard, then it is possible to save the schema with the settings in the template database. In this case, the alias name can be used to access the settings. If the settings are not stored as a schema, you can also pass the settings directly in the form of an XML string of the function. You can save a stored schema in an XML file in the Organizer dialog box. You can also directly access this type of XML file in ReadTextData. If an entry in the file cannot be interpreted as a number, then a void floating point value is entered at the corresponding location in the result.

    1. You can manually import the file as links and to inspect the created formulas since the configuration is now much more powerful and has to be done as an XML excerpt.

    2.Using Import Schema

    Using the Import Wizard(Text Files (Wizard)(*.*)) you will import your file. At step 4 you will check the “Save import schema”.
    Lets say you imported your file and saved the schema as “Current5_Schema”

    You can use now the new function ReadTextData as follows:

    Dim filePath = "D:\Tmp\Current5.csv"
    Dim schema = "Text - Current5_Schema"
    
    //ReadTextFile(filePath, 4n, 0n, 5n, 5n, False, TYPE_FLOATINGPOINT64, False, ";", True)
    //converted to
    ReadTextData(filePath, schema, 5)
Voir les messages de 2 - 1 à 2 (sur un total de 2)
  • Vous devez être connecté pour répondre à ce sujet.