Problem reading text file

CVI programmer for several years, but it has been awhile. Trying to read in a text file that displays fine in say Notepad. The first line of text in the file is:

All temperatures in ° F.

If I use the scan function, say:

public static char cdum [2048];

ScanFile (DataFile, "%s > %s", cdum); I get these results:

cdum [0] is - 2

cdum [1] is 65 (which is the ASCII character 'A')

The rest of the cdum is all zeros.

In a hex editor in decimal display grouped by bytes, the line is:

0 255 254 65 0 108 0 108 0 32 0 116 0 101 0 109 0 112... as the display looks like

ybA.l.l.. t.e.m.p.e.r.a.t.u.r.e.s.. i.n.. °. F....

So I get the scan function is to see the start character, then by pulling the 65 and placing in the location cdum [1], then strikes the character 0 and leaves the function of scan as she found an end of line. Trying to read in the entire line and the subsequent data float line, but is not serious, I can understand that our after I get over the initial problem above.

Can someone help me with this? I have no problem reading in ordinary text files, but this one is as it is grouped in words rather than in bytes. Have you tried a bunch of different Scan function modifiers source and target [xt0, w #, etc.], but nothing seems to work.

Data file attached.

Thank you-




I downloaded your file, it is opened in Excel because of its extension and the settings on my computer. I then wanted to save it as a text file normal to see in Notepad and read with a simple C program. In doing so, Excel told me: some features in your workbook may be lost if you save it in Unicode text.

This is consistent with your observation of 16-bit data.

LabWindows/CVI, unfortunately, does not support the Unicode character set and functions of the library operated at only 8-bit characters.

So I would say to convert your file to 8-bit characters; You can also support the pursuit of the Unicode support in CVI here

Tags: NI Software

Similar Questions

  • How read text file and decode

    Hi, I have a file which consists of 2 columns, it is first of all time/date stamp and 2nd is ON / OFF text.

    I would like to determine the time when the text is ON or OFF.

    I am not able to analyze the data in separate columns 2 and then read, can someone help me on this?

    The example of the file is attached.

    I was going to throw away the solution, but bob and cruz are probably right, that he is HW.

    What is the problem with your vi above, is that you are matching the model from the OFF, but you don't have a table, so your search through your entire text file and on the OFF first display you text in front of her. You must first create a picture of your spreadsheet from the read text file string. This can be done either by using a string of worksheet function array or as cruz said the spreadsheet file. Im not sure of your desired end result, but from there you can feed in a for loop and find each item ON or OFF.

    That should help you get started.

  • Can I read text files in Multisim 11.0?

    I want to take data outside. So, read text file in Multisim 11.0? Or, can I import Chart 11.0 Multisim LabVIEW?


    Here is a step by step tutorial:

    The use of LVM in Multisim

    There is something when you configure the file LVM in LabVIEW. In the window to write in the file of the measurement , value X column field, check that you select a column only. Multisim must have this explicit time column when you import data.

    If you still have problems to fix your VI, LVM file and the circuit.

    Kind regards

  • close the reference on "read text file" - Ref num vs prefer class conflicts

    Dear users,

    Vi Analyzer asks me to close the refernce created by VI "read text file". So, I would close a refnum created by primitive VI "read text file". I used a direct wire, wiring by top and bottom of the casting, but each of them attend class conflicts (see the screenshot below). It is even possible to correctly transform the refnum (byte stream type reference) to refer (reference VI generic) and remove the refnum?

    See you soon,.

    You must use the close file.

  • Error when you try to play audio files: Windows Media Player has encountered a problem reading the file. for further assistance, click web help

    8007007E tips

    There is also another number which is C00D11B1, but both have to do with the lock of the music in windows media player, the message said:-"Windows media player has encountered a problem reading the file; for help click web help. ""- and that of all, but when ' web help ' click on the show numbers that are 8007007E and C00D11B1 and average music, not Windows media player, y at - it someone with the same problem that has been able to solve? Thank you, let me know, if you don't mind, thank you again.

    I suggest re-download you WMP 11 from the following link and install it on top of the current installation:

    Who help me?

    If this isn't the case, please report the file type (extension) of the file you are trying to play. For instructions on how to make Windows Explorer shows the file types, see this link:

  • Reading text file takes a long time after the first time

    Dear experts LabVIEW,

    I'm having a problem with playback of text file. I'm reading only each Nth line from a file to preview with this sub vi:

    I seems to work the first time I do it well. The loop takes almost no time to perform an iteration.

    Then when I load the same file with exactly the same parameters an iteration takes about 50ms.

    Subsequent attempts always seem to take longer execution time.

    Only when I restart the calling vi fast for a single file.

    When executing the sub vi alone it is still fast, but I don't see how the main vi (too complex to post here) could hinder the execution of the Sub vi.

    I have no one else to open the file in the main vi, I do not use too much memory...

    Just now I have not now where to look. Does anyone have an idea?



  • Syntax to detect the line feed or newline read text file?

    I have a SQR (aka Hyperion Production Reporting) program that treats a comma-delimited text file.

    Sometimes one of the fields contains carriage returns and line breaks, that's not groovy, as is the record delimiter.
    The program currently handles this situation by disgarding records that do not contain the specified number of fields.

    I would like to scan the file before treatment, pickling, transport and line breaks, returns when they are integrated in a record.
    I have problems with the syntax required to recognize these characters, however.

    The program reads the file in a string (for example read 1 $record_buffer: #len).
    then it executes a while loop that examines the $record_buffer string one character at a time.

    I tried a direct comparison: If $char = Chr (10) or $char = Chr (13)
    I tried to assign a chr() value to a variable before the comparison: Let $LF = chr (1)... If $char = $LF
    I tried using code before the comparison: encode '< 10 >' in $LF... If $char = $LF...

    Could someone help me with this?

    Thank you!

    Here's the syntax that works:

    #ifdef EBCDIC
    encode "<13><37>" in $hr
    encode "<13><10>" in $hr
    #end - if

    (replace the return with the null character)

    LET $descrlong = translate (& descrlong Chr (13), ")

    OR try the following code:


    ! Retrieve a line *.


    ! This local function / procedure will look for tank 13 which is a line terminator. The position where is returned

    ! to the routine.

    ! Parameters: $strToRead = this string that contains the formula is parsed to find the tank 13 (end of line) identifier

    ! : #startPos = the position where we need to find the identifier EOL

    ! : #PositionFound - this by the reference variable returns the position where the EOL.


    BEGIN-process Get-Line($strToRead,#startPos,:#PositionFound)

    Let #PositionFound = instr ($strToRead, chr (13), #startPos)


  • having problem reading pdf files

    Hello world! My name is HP slate 7 HD 3403ea. I'm having some trouble reading PDF files. That day, after that I bought my tab, I transferred about 25 PDF files from my handset to this tab. I could open all the files then. But a few hours later, when I tried again I could open only a few files, about 8 of them. I couldn't open the rest of the files. They showed "cannot open the file because it is not a valid PDF document.". Let me say clearly that all files that cannot be opened in my HP tab, can easily be opened by any other official bulletins, for example: my HTC handset or my HP laptop. I tried different things. I uninstalled the antivirus thinking that may be the cause of the problem, I tried various recognized appstore PDF readers, but none worked. Only 8 or 9 files can be opened now. I deleted all files "disabled" what we call, then donated to them. But it's the same thing. Each file can be opened immediately after the transfer, but none could be opened after a few hours. Help, please. Thank you.

    Hey @Atonu_dt ,

    Welcome to the HP Forums!

    I understand that you are having problems to open PDF files on your Tablet HP Slate 7 HD.

    Try to clear the cache on the tablet. You can do this by going to settings > storage > cached data. This should prompt allows you to clear the cache on the tablet.

    I also suggest to try the App PerfectViewer. To read PDF files, you will also need the PerfectViewer PDF plugin. These two are easy to find in the Google game store by searching PerfectViewer.

    Let me know if it works.

  • creating or reading text files based in compiled vi (.exe)

    I did my .vi which contains features for reading/writing of settings and write log files. All goes well until I want to create an executable to distribute to colleagues who don't have labview development. When you run the .exe, it seems that I can't create or read .txt or .ini files. No idea how I can import functions open file in read/write/text to my .exe?

    In fact, you try to create or read a file inside the executable.  Of course, this won't work.  Instead, use the Directory of the Application.  It returns the folder that contains your project (in the LabVIEW environment) file or the folder of the executable (when in the execution engine).

    So in your example, you just have to the Application Directory and the path to build to get the location of your settings.ini file.

  • Read text file on a desktop used as target RT to the host PC.


    I'm using LabVIEW 2012 and I want to read a text file on your desktop PC used as target RT to my host computer.

    What is the the path to the target RT?

    Thank you very much

    Hi msad,.

    Why don't you use the ftp functions to access a file by ftp address?

  • Reading text file and graphic

    Hello everyone. I'm new to Labview and have started using it only a week ago. My advisor gave me a difficult project and I'm stuck. My goal is to recover data from a Keithley instrument by setting voltage and current measurement. I could find a driver to do, but now he wants me to take my measurements and make a different chart that is already in the driver. The graphic I get is for X vs Y that has tension on the horizontal axis and the vertical current. After I receive this information, it is then saved in a .txt file. Which wants me to my Advisor, is to take the values that are recorded and divide (V / I) which is equal to the resistance and then to draw resistance depending on the tension. Since I am very new to Labview, I have trouble reading the text file, strength design values and the tracing result. To add to my troubles, the computers I use have only up to Labview 7.0 Express. If anyone can help me please, it will be greatly appreciated because I would rather graphic using Labview values instead of using Microsoft Excel. Thank you.

    Sorry, misunderstood how you want to display the data. The first table seems to be the tension and the table that is the output of the divide is the resistance. Instead of build table and a graphic waveform, you'll want to use the bundle where the upper entrance is your x axis and the background is the y axis and sire of the output of the present in a XY Chart.

  • Failed to read text files in Windows vista

    Hello, I had to remove a hardrive and install it as a secondary hardrive in another computer (my work horse). I can't read the text files they look incrypted all belong. photos look fine cannot test the music but I guess that's good because the photos look fine to me even if I tried to copy or move files successfully, so I think that there is some kind of security issue here I need to understand. It started because of a defect of card mother hp slimline and the customer is not able to buy a third computer. My goal is to copy the data on the Flash drive and just copy the files on him another computer. I need help with what I am an old person xp to the rebels to leave the mountain. Thank you for giving your time to read this. Oh yes, I'll leave the porch lights on!


    You don't have the program installed on your computer so that these files were written in.

    Check their file extension.

    See you soon.

    Mick Murphy - Microsoft partner

  • Reading text file issues

    Hi all

    Long the time lurker, first time poster , like the forums here.

    I'm still new to BB development, so my approach may be the issue.

    I am applying for a deck of cards popular (utilities etc.).  I have a text file with the number of card games n, followed by n lines with 3 character code set and then the number of cards in the game.  I'm trying to use it to create a string array and an array of integers with the size of the number of reading games, then read the rest of the values in a loop to their respective indeces.

    I have read several articles on the forums here, and I can't seem to find a way to do it.  I am able to get the number of games using the:

                  InputStream is;                        String result;                        int numOfSets;
                            try {          FileConnection fconn = (FileConnection), Connector.READ);         is = fconn.openInputStream();             byte[] data = IOUtilities.streamToBytes(is);          result = new String(data);            numOfSets = Integer.parseInt(result.substring(0, 1));
          }     catch(IOException io) {

    Is there a better way to do it?  It seems it should be a little more easy/short.  I looked through the API for a class such as Scanner, StringTokenizer or even a SplitString option.

    Thank you


    Lurker welcome!

    I presume that your dataset is all text and not a combination of binary and text?

    There is no easy way to split a sequential string of data.  Most people, when you consider a dataset like this, would introduce formatting, such as XML, JSON or even CSV, to make the data easier to analyze.  Since you don't seem to have anything, then I think you're going to cross the characters at once...

    If you use only standard ASCII, then it would be more effective to go through the array of bytes.

    Otherwise put characters of separation in there and look for using some tokeniser.  It is not a standard, but there are whole number (including at least one on the forum of the memory).  In addition I see StringUtilities - you might be able to use one of its features for tokenized your channel.

  • Reading text files and databases

    There the good tutorials on read/analyze the text files and databases out there? I've been looking around, but I can't really find anything.

    Yes - Here are some links:

  • How read text file and store it in the database

    Respected by all,

    I have the text file on my computer.
    I use forms6i and oracle 9i.
    I want that when I press the button then specifice world in text file is read and display on the form to be stored in the database.
    Please provide a solution.

    Kind regards


    Studying the functions of the package TEXT_IO()


Maybe you are looking for

  • Satellite L10 - 114 - it has a DVD burner?

    My laptop has a DVD burner on board. I know he'll make the CDs, but it will make the DVD. [Edited by: admin August 6 05 16:38]


    I have a laptop Tecra A10 - 15 ° c which has a Hitachi 250 GB hard drive.My client was 1st a password CMOS and here after a HARD drive on the HARD drive password. My problem is that the customer does not know what is the password for the HARD drive.W

  • Wars of the label... A new hope

    Dear Apple EMPIRE It's so boring that you deleted these good old labels colored for a clear and attractive marking files and folders. In this regard, these tiny dotty tags are just a joke and unusable. It may be nice to have any FURTHER with all thes

  • Spectrum 360 HP: HP spectrum 360 clikpad

    I try to remove the use of the option to zoom on my Hp spectrum X 360 clickpad It works but when I close my laptop, the zoom option always come back.  Is this normal? Thank you

  • HP envy 15-k201nv: HP ENVY 15 drivers for win 7

    Hello I'm looking for network drivers + all drivers for HP ENVY 15 drivers for win 7. Could someone help?