Convertir un fichier texte UNICODE en ANSI

Bonjour,
Je vous explique ma problématique.
J'ai une application qui me fournit un fichier txt. Lorsque je l'ouvre avec mon vi je le vois a peu près correctement mais il y certain charactères bizzares qui apparaissent. Deplus il me crée des espaces entre les lignes et c'est impossible de travailler dessus avec les fonction labview.
Pour remedier à cela, je suis obligé de l'ouvrir avec le bloc note et de l'enregistrer en le passant au format ANSI.
Une fois cette action faite, tous deviens normale et je peux faire fonctionner mon VI.
Ma question est:
Est il possible de le faire en automatique car j'ai beaucoup de fichier à traiter.
Je vous met en fichier joint un example de fichier .txt que j'ai en sortie de mon application,
il n'a qu'une ligne mais si vous l'importez avec Labview, vous verrez que dans la premiere case du tableau il y a un charactère bizzare et que labview creer 2 lignes supplémentaire vide.
Si vous faite la manipulation de sauvegarde au format ANSI avec le bloc note tous devient normale
Merci de votre aidre car je suis un peu coincé et mon application Labview n'à plus lieu d'être si cette convertion n'est pas faite en automatique.
Cordialement,
Résolu !
Accéder à la solution.
Pièces jointes :
P2 BTH CF toutes Gauges Ligne_41.TXT ‏1 KB

re
Si tu veux tester. C'est une méthode... bien particulière, voir expérimentale. Pour étudier le code Unicode to ANSCII, j'ai modifié un vi du site de NI. Je transforme l’Unicode en ANSCII, en ne gardant qu'un U8 sur 2. Les 2 premiers U8 définissant que le fichier est Unicode 255 puis 254. En ne gardant qu'un U8 sur 2, si le deuxième est >0, alors c'est un caractère spéciale, donc je le supprime. Convertir est… terminé.
Luc Desruelle | Voir mon profil | LabVIEW Code & blog
Co-auteur livre LabVIEW : Programmation et applications
CLA : Certified LabVIEW Architect / Certifié Architecte LabVIEW
CLD : Certified LabVIEW Developer / Certifié Développeur LabVIEW
Pièces jointes :
File Unicode To ANSCII.vi ‏18 KB

Similar Messages

  • Ecrire des nombres binaires dans un fichier texte

    Bonjour, je suis actuellement en stage, et je dois faire l'acquisition du signal d'un radar météo.
    Je récupère les données mais j'ai un problèmes au niveau de l'enregistrement dans un fichier texte.
    Je récupère un WordStatus (mot non signé de 16 bits) puis un tableau de 100 mots non signé 16 bits et enfin un Timetag sur 32 bits.
    Mon but est d'enregistrer le premier mot, suivis d'une tabulation, ensuite les 100 mots séparés par des tabulations et enfin le dernier mot (toujours avec une tabulation)
    J'arrive à écrire dans un fichier texte le tableau de 100 mots en utilisant le VI "Tableau en chaîne au format tableur" mais je n'arrive pas à convertir mes autres mot binaire en chaines pour pouvoir concaténer le tout (pour finir avec un "Ecrire dans un fichier texte".
    Pouvez-vous me donner des pistes ?
    je peux joindre un VI sur demande.
    J'espère avoir été clair.
    Merci d'avance.
    P.S. : Je travaille sous Labview 11.0.1.
    Résolu !
    Accéder à la solution.

    Bonjour et merci pour votre réponse.
    C'est vrai que j'ai oublié de préciser que je travaille avec des VI déja programmé livrés avec la carte d'acquisition (Excalibur) ; et que l'avion étant en maintenance actuellement, je ne peux pas faire de test en condition réelle. Je pourrais Jeudi prochain me rendre chez UniAir pour faire tourner le radar en mode test. Le protocole utilisé est l'ARINC 708.
    Il est vrai aussi que si je pouvais avoir accés directement à la trame originale, je pense que j'aurais moins de problème (j'y pensais hier soir ; impossible de dormir). Mais je ne pense pas avoir le niveau pour aller modifier les drivers. (cf VI : "Acquisition708-Vtest.vi")
    Ensuite, j'avais déja pensé à convertir ces mots en valeurs décimales (je n'aurais qu'a préciser mes formats d'enregistrements aux scientifiques qui voudront traiter les données post-acquisition.) J'ai d'ailleur appliqué vos conseils dans le VI "Exemple-Random.vi". Je me sert de ce vi pour faire des essais à partir d'un tableau remplis de valeurs aléatoire. J'y inclus aussi le traitement des pixels pour l'affichage des données (pour les curieux...)
    Lancer le programme et actionner Acquisition.
    Enfin, pour optimiser la vitesse (le signal est échantilloné a 1Mb), je commence à peine à regarder de plus près le vi "Ecrire dans un fichier binaire". C'est peut-être par la que je trouverais mon bonheur.
    Cordialement.
    Rémy, en stage au CNRS SAFIRE.
    Pièces jointes :
    Acquisition708-Vtest.vi ‏23 KB
    Exemple-Random.vi ‏433 KB

  • Chargement de valeurs analyseur depuis fichier texte

    Bonjour,
    Pour mon projet de BTS je dois contrôler un analyseur de spectre depuis LabVIEW, j'aimerai savoir comment charger des configurations (valeurs) depuis un fichier texte par exemple.
    Enfin que si l'on charge les valeurs d'un fichier spécifié, elles se placent automatiquement ou l'on veut.
    Merci d'avance,
    Florent.

    Si tu fais un fichier texte de ce type par exemple pour tes données :
    Il te suffit de tout lire, et de traiter tes données dérrière pour récupérer les valeurs qui t'interesse :
    En utilisant la fonction recherche d'expression par exemple !!  
    Est ce que ca correspond à ton besoin ? 
    EDIT : Si tu as besoin ensuite il te suffit de convertir tes valeurs en nombre en utilisant la fonction appropriée dans la palette chaine
    Pièces jointes :
    Lecture fichier texte.vi ‏14 KB

  • Problem deleting cross-references: Deleted cross-references do not convert to correct text

    This helpful page states that, "When you delete a cross-reference, the source cross-reference is converted to text."
    I use InDesign to create user's manuals, which are full of cross-referenced page numbers.
    The cross-references are all internal to a single document, they do not link to other documents. Each cross-reference is linked to paragraph text and the cross-reference format is Page Number.
    I find that whenever I delete a cross-reference, the cross-reference does convert to text; however, the text—which in this case is a page number—is wrong.
    For example, this sentence is on page 16:
    "You can measure your heart rate using either the handgrip heart rate monitor or an optional chest heart rate monitor (see page 21 for information about the optional chest heart rate monitor.)"
    Screenshot:
    However, when I delete the cross reference, the sentence now reads:
    "You can measure your heart rate using either the handgrip heart rate monitor or an optional chest heart rate monitor (see page 16 for information about the optional chest heart rate monitor.)"
    Screenshot:
    Now, to my mind, the cross-reference should have converted to the text "21," since that is what the cross-reference said (and it is the correct page number for the optional heart rate monitor text that is being referred to).
    Instead, the cross-reference converted to the text "16," which is the number of the page that the sentence is actually on, but is most definitely not what the cross-reference said and is not the correct page number to boot.
    Do any of you know the reason this happens?
    Is there a way to make the text convert to the correct page number when the cross-reference is deleted?

    Update: The cross references work when I export the book as Print PDF. Sadly this solution does not work in my case, because all my interactive element are disabled when exporting as Print PDF.

  • Attachments converted to plain-text when using redirect rule

    When I redirect emails using a Mail rule, any attachments (as well as the entire message) are converted to plain text with extra control character, rendering the attachment unviewable. This does not happen when I manually redirect an email. Any help you can provide would be welcome.

    When I redirect emails using a Mail rule, any attachments (as well as the entire message) are converted to plain text with extra control character, rendering the attachment unviewable. This does not happen when I manually redirect an email. Any help you can provide would be welcome.

  • HT2523 one of my documents suddenly converted to plain text can't get it back. it had charts etc all over it. have been working on it for about 5 months lost a lot of work. Help. can i get it back?

    One of my documents on textedit suddenly converted to plain text and i can't get it back. Help. Spent over 5 months working on it. Had tables etc. Can i get it back?

    TextEdit/Preferences/New Document - Rich Text selected?
    Open & Save/When Opening a file - the 2 settings unchecked?

  • Can I convert Facebook time Text to Project Siena's Date value ?

    Can I convert Facebook time Text to Project Siena's Date value ?
    I want to show create_time on screen by my Localtime formatted text.
    Facebook time Text = 2014-07-14T11:22+0000
    I want to show = 2014/07/14 18:22
    My Time Zone is +09:00, Osaka/Japan.
    Currently I try it by Text/Replace/Replace/Replace/Left/DateValue/+ , etc.
    And I ask more simple way.
    Regards,
    Yoshihiro Kawabata

    Thank you Andy , and Robin, I can.
    Text(TimeValue(Substitute(ThisItem!created_time,"+0000",".000Z")),"yyyy/mm/dd hh:mm")
    At Facebook Albums's Gallary, I can convert from Facebook created_time to Localtime Text DateTime.
    and I hope more easy way like Excel Power Query's one.
    Regards,
    Yoshihiro Kawabata

  • Can I convert Twitter time Text to Project Siena's Date Value ?

    Can I convert Twitter time Text to Project Siena's Date Value ?
    I want to show localtime of Twitter created_at.
    Twitter time text = ThisItem!created_at , ex: Tue Jul 15 17:19:00 +0000 2014
    I want to show 2014/07/16 02:19 by Japan localtime.
    Regards,
    Yoshihiro Kawabata

    Siena uses JavaScript to parse date/times, via the TimeValue function. A good specification regarding what is acceptable can be found here:
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
    The example above is truly bizarre: I thought I had seen it all. You will need to turn that form into one of those listed on the above site, using string functions to chop it up and reassemble it into a saner form.

  • Convert XML to text file and sending the same via Mail receiver adapter

    Dear All,
    I have a requirement like....
    I am getting a XML file as a result of mapping and it needs to be converted to a TEXT file and
    the converted file needs to be sent to a mail address in text format.
    Any body has idea how to achieve this?
    Thanks in advance for your help.
    Regards
    Hari

    >
    HP CReddy wrote:
    > Dear All,
    >
    > I have a requirement like....
    >
    > I am getting a XML file as a result of mapping and it needs to be converted to a TEXT file and
    > the converted file needs to be sent to a mail address in text format.
    >
    > Any body has idea how to achieve this?
    >
    > Thanks in advance for your help.
    >
    > Regards
    > Hari
    use the StructXML2Plain or XML2Plain from the standard MessageTransformBean
    Add the module to you Mail adapter before the mail adapters standard module itself
    Ref: http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

  • Graphics convert but not text even when ocr is disabled

    graphics convert but not text even when ocr is disabled

    Hmmm... I seem to have found the plist file that is doing it. I was looking at /Library/Application\ Support/Apple/Remote\ Desktop/ before... looks like /Library/Preferences/com.apple.ARDAgent.plist is the culprit.
    This plist is a binary, so I had to use plutil to convert to xml in order to make it human readable. I wonder if I can just hack this file up a bit and re-deploy it to each machine. Or I wonder if it would re-build if I simply remove it from each client. I will need to test to find out, seeing as though the task servers are listed in it, probably not a good idea to remove it all the way.

  • Hi, I have used PDF export for some years. One file will NOT convert to readable text in Word.  Some

    Hi, I have used PDF export for some years. One file will NOT convert to readable text in Word.  Some headers and maps in this document are converted OK but the body text is garbled. I have tried converting to Docx, Doc and RTF with no success. I disabled OCR and it made no difference. What can I do please?
    Les

    Hi,
    Can you please provide me the file with which you are facing the issue.
    Thanks

  • Adobe Distiller converting to garbled text

    Hello,
    I work desktop services for a company. I have user who is trying to convert a ps file to a pdf. However when she does it converts to garbled text. I embedded the fonts that distiller says are missing, but once she goes to convert the ps file again, it just keeps saying the fonts couldn't be found. I had her check with a fellow employee who was converting the same file, and they didn't have any problems and were missing the same fonts, plus even a few more. The user is using Adobe Acrobat 8 standard. Any ideas?

    I tried this it didn't work either.
    I looked at her settings again, her compatibility settings is for adobe version 6, and she is actually using 9. Not 8 like I previously mentioned.

  • Unable to convert dates to text in scanned PDFs

    I am using Adobe Acrobat XI Pro. I am converting scanned images to text by recognizing the text using OCR.
    However, some portions of my file, specially dates in format MM/DD/YY format are not being converted to text. I cannot even convert them to text by clicking "Find All Suspect" under "OCR Suspects" since they are not being listed.
    Please help.

    Find All Suspects does not convert to text but it gives the option to accept a text as converted by the OCR. However, in case of the dates, this is not an option since the date is being treated as an image. Any other method which might help to recognize dates as text?

  • Convert an outlined text back to editable text

    Hai
    Enything possible to convert an outlined text back to editable text in Adobe InDesign?
    Thanks
    Ashok

    It might be more than one step. You need to:
    Change the vectors back to live type
    Style the live type with the correct font, size, leading, etc.
    If you're looking for something that does all that in one step, I don't know of it. There are OCR (Optical Character Recognition) programs available. Adobe Acrobat (the full version, but I don't know about Adobe Reader) is one option. Keep in mind that there may be some work to do after the vectors have been changed to type. In the screenshot from InDesign below:
    …the black text is placeholder text that I made for this example, I changed the text to outlines and exported as PDF. I then opened the PDF in Acrobat and went to Document>OCR Text Recognition>Recognize Text Using OCR. After the vectors were changed to text, I selected and copied the text, went back to InDesign, made a new text frame below, pasted the text and colored it red (for contrast). You will see that it did a pretty good job of changing the text, but it added paragraph returns at every line break. And if you look at this closeup of part of both texts close to each other:
    You can see that the text isn't exactly the same. I think this is may be due to InDesign automatically selecting  kerning pairs as you type, which weren't selected in the OCR process. I'm just saying that OCR isn't foolproof.
    And after you get your text, you will likely have to style it yourself. If there are programs that will do better, I imagine someone will come along and suggest some.

  • Want to convert plist to text

    I want to convert plist to text because I accidently deleted Sticky widget and want to get the text back (via Time machine) then just create a document with the information.
    I need something non techinical - I googled it but was not easy to find a simple solution.  I tried downloading Apple developer tools but took so long I cancelled the down load.  I tried an internet convertor but the file was blank.  I know it is not as I can see the actualy text but failing all this I will edit the file manually but that is tedious work.
    Thank you.

    Not quite sure your problem.  Open plist with TextWranger.app and it is text. You can copy and paste into TextEdit.app if that helps (plain text.)

Maybe you are looking for