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!
Laura

Here's the syntax that works:

#ifdef EBCDIC
encode "<13><37>" in $hr
#else
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)

Proceedings

Tags: Business Intelligence

Similar Questions

  • 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.

  • 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

    Hello

    Studying the functions of the package TEXT_IO()

    http://www.Oracle.com/webapps/online-help/forms/10G/State?navSetId=_&Navid=3&vtTopicFile=f1_help/Oraini/c_text_io.html&vtTopicId=

    François

  • Detect the line breaks in htmlText

    I know that you can identify line breaks when you work with text files by checking the equivalent of character, but are - can I do this with htmlText?

    I do a text editor for my client and I use the component textArea as input field with the data stored in an XML file. Everything is good, except for the line break - the textArea is rendered as htmlText so that the customer will be able to see the changes instantly. By default, it works, but the spacing is screwed (dashes, double spaces sometimes), so I decided to condense white space. With that, he got rid spacing issues since the html is rendered exactly as the code name. The thing is, hitting enter in the text box does not add < br / > the code htmlText.

    I need to replace the key of the entry with a custom function that inserts an ine jump when you use the text box, or there at - it a way to detect and convert these line breaks in htmlText?

    don't you see

  • Need syntax to get the lines of error in Sql Plus

    Hello

    Could you let me know the command for below.
    After you type SHOW of ERRORS in sql like I get the list of errors as below.
    How can I get the error lines, I want to look at the lines of 1520 to 1525.



    1523/9 PL/SQL: statement ignored
    1693/12 PL/SQL: ORA-00984: column not allowed here
    1776/11 PL/SQL: statement ignored

    Thank you

    Hello
    In SQLPLUS, you can select view ALL_SOURCE to see the source code for the package.

    VIEW all_source
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     OWNER                                              VARCHAR2(30)
     NAME                                               VARCHAR2(30)
     TYPE                                               VARCHAR2(12)
     LINE                                               NUMBER
     TEXT                                               VARCHAR2(4000)      
    

    However, you can also use SQL developer or another IDE that make life a little simpler.
    VR,
    Sudhakar B.

  • detect the line break

    Hi I was wondering if someone could help. As my deadline is looming at a dangerous point and im stuck.


    I have a dynamic text field in flash which is filled by an entry box.

    The dynamic text field has a maxmium width that we. So I also multiline WITH wodrwap on.

    My problem is I have to send this data to the server and php power text text and output text as it is displayed in flash.

    There seems to be no way to find line breaks and pass in the string that I can see? Does anyone have ideas on this issue or a workaround?

    The noose tightens.

    THX in advance

    ADE

    It worked guys here:

    you will find the line breaks, however, you lose the real break and replace it with what you want (for example. "
    ")

    It's all the text that you need:

    origStr = orig.text
    newMessage = origStr.split('\r').join('
    '); newText.text = newMessage

    Entry:

    Hi
    There
    
    How Are You?
    

    Output:

    Hi
    There

    How Are You?

    It's funny how works '\r' and ' / r ', ' / n ' and not '\n '.

  • CFFILE - reading text file and maintenance of line breaks

    I am using cffile to read a text document, then add then display the content of the text document in a file .xml for an atom feed. Everything works fine, but it seems that cffile is stripping on the line breaks in the original file so that the contents of the variable which is save has more no line breaks. Is there an attribute that I'm missing that will control this behavior or I have to go about it in different ways. Thanks in advance for any idea on this issue.

    Why do you say that line breaks are removed?

    If you just say that because when you look at the results in your browser.  Recall that the HTML standard ignores all the line breaks and most other white space.  A quick overview of the source will tell you if the line breaks are there or not.  Using the HTML code

    ...
    Tags is the right way to tell a browser not not to ignore white space in the source.

    But it is possible that somewhere along the process of conversion of text file to XML data line breaks are stripped.  But then, we would need to see significant process pieces for a chance to help you.

  • 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?

    Concerning

    Florian


  • write the table in its entirety in text file after completing the data collection

    Dell NetBook, Windows XP home, OR-6008, Labview 8.5.1

    I read a psydo real-time app 8 analog signals at 100 Hz.  I can't write directly to a file of data during data collection (processor flash drive to slow down), but can store 4 2D tables separated, with one added timestamp data.  Once I finished collecting data, I would record each table in a separate text (csv) file.  Using takes a loop for in long and using the 'picture to a worksheet string' add labels that I can't change.  I'm climbing down a text file of 3 columns and lines equal the number of samples, I've collected (e.g., a 1 minute session would be 6000 rows and 3 columns).

    1,1.3,1.5,

    2,1.2,1.4,

    3,1.4,1.1,

    4,1.5,1.2,

    5,1.4,1.4,

    etc.

    Thank you

    Troy


  • Why can't the system find/open executable a text file when run in labview?

    The executable system works perfectly when it is in the folder. He is able to open the text file.

    When the executable is launched through LabView, it returns however it cannot open the text file.

    Is this a problem that I can fix it or what I need to find another way to enter data?

    Thank you.

    Wire you the entry 'working directory'?

    Can you show us a code?

  • Writing a single line of numbers in a text file or write several lines each iteration?

    Hello

    I am currently working on an application that has a few different time-loops at the same time. A single loop acquires data (DAQloop), another shows the data (raw and processed data) on graphs (Graphsloop) and another stores data in an open (Storageloop) ascii text file.

    The data is passed to the DAQloop to the Storageloop through a queue. Now, I leave the Storageloop take the first element of the queue (oldest) to store in the text file each iteration. However, I was wondering if it would be better to let the Storageloop take all items currently available in the queue store at once.

    Does anyone have ideas on this? Who better its? The text file is already open and is simply passed as a refnum.

    THX!

    With normal file primitives LabVIEW, you will get your best speed of disc when you write about 65 000 bytes of disk at once (or read, incidentally).  When I write a similar code, I included a string buffer in the loop of Scripture.  Whenever I get data to write, I add it to the chain.  When the chain hits 65 000 bytes, I write to disk.  You could break this into three loops, as well - a read buffer, and write.  Depending on the current size of piece, you could see a change in the order of magnitude of the speed of disk write.  This write operation is often limited by the conversion from binary to ASCII, not the disk i/o.  If you do this, be careful with your buffer.  You can get some serious slowdowns depending on how you implement it.  This post has some details and examples.

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

    Hello

    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?

  • How to detect the webcam feed without receiving those

    Hello!
    I am looking for a way to know when the user (everything in the room/group) begins to make look her webcam and stopped.
    I tried to add the listener to StreamManager

                protected function cameraview_initializeHandler(event:FlexEvent):void{
                    this._connectionSession.streamManager.addEventListener(StreamEvent.STREAM_RECEIVE, this.streamReceivedHandler);
                }
                protected function streamReceivedHandler(event:StreamEvent):void{
                   trace('stream received', event.name, event.streamDescriptor.groupName, event.streamDescriptor.streamPublisherID);
                }
    

    And STREAM_RECEIVE called when another user starts to appear, but the event a groupName = null and streamPublisherID is NULL too.
    I need it to give the possibility to choose the flows required to play and more low bandwidth.
    I tried to use WebcamSubsriber too, but it begins to show the right to water courses when it is received.
    What did I miss?

    You can do something wrong. You can send me a code test and where you found null so that I can run on my sides and point of any error or debug inside.

    Thank you

    Hironmay Basu

  • After a search of the library of bookmark for some a bookmark (and believes it is research), how did you then say it's in the folder? There should be a column 'File' in the line of title like this, Tags, file name, location. Thank you.

    A search in bookmarks in the library should provide each bookmark folder and name, Tags and location.
    As it is now, a search (for example) for the string 'IESI', a company in the center of Texas garbage collection, actually concludes IESI. But what happens if you don't remember which folder you put the bookmark IESI? Ongoing research fails to provide information of record.

    See:

  • How to export my history of travel (including the date and time) to a text file?

    I need to collect data on the amount of time I spend on specific sites, research on my thesis topic. In my browsing history data. I need a way to export the data from the history file including the date and time information in a format that is easy to parse (.txt file delimited by commas, etc.)

    You are welcome

Maybe you are looking for