Text mode opened file and line feed

Good morning:
I have open a file in text mode and i need to send an OD0A hexadecimal characters to another system in each line, if i try to put 0D0A it makes a double line feed and if i only put 0D it doesn´t interpretate 0D like hexadecimal characters, i know that if i open the file with binary mode it would be very easy, but it is a code shared with another programs, so i rather not to change. Does anybody has made that in text mode in any occasion?.
Thanks in advance
Regards

i have open the file in binary mode

Similar Messages

  • How to find a carriage return and Line feed?

    I need to detect if a crriage retunr and line feed present on each row in my text file before allowing user to upload the text file
    I know how to remove them from each line but what I need is to detect them no removing them from file.
    Our concern is when the a row does not have carriage return and line feed.
    Is there a way to find this using CF? Please help
    thanks

    That is exactly the problem Dave, if some rows do not have line feed, they're not being inserted into DB, it skips other steps and go right to finish. It looks
    like the file is done processing.
    So I need to do early rejection to this kind of file.
    I used cfloop to catch anything else that do not follow the formatting rules.
    Here is what I already done:
    Right after the file got uploaded, I have these codes:   
    <cfloop  index="x" file="#MyFile#" >
      <CFSETMyLine = Replace(x,chr(9),"|", "ALL")>
      I'm using a few functions, such as, Left(), Mid(), Right(), etc to make sure certain rules are followed.
      Up till here, it's done and tested, everything is working.
      The only problem is when 1 or more rows don't end up with line feed and or carriage return.
      I plan to add some codes to check the end of each row for chr(10) since it is looping for every row anyway.
      If detected, process file normally otherwise stop processing.
    </cfloop>
    So this can't be done in CF?

  • My external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive. Same thing has happened with Final Cut Express.

    My new LaCie external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive.
    The same thing happened recently between Final Cut Express and my other LaCie external hard drive used as the Scratch disk. It fixed itself.
    I've run out of ideas. Help would be very much appreciated. Thanks.

    have you done some searches on FCPx and time machine? Is there a known issue with using a TM drive with FCPx? dunno but ...wait...I'll take 60 sec for you cause I'm just that kind of guy....   google...." fcpx time machine problem"  Frist page link 
    http://www.premiumbeat.com/blog/fcpx-bug-best-practices-for-using-external-hard- drives-and-final-cut-pro-x/
           You cannot have time machine backups on your hard drive if you intend to use it in FCPX.
    booya!

  • My account is active and paying per month for Acrobat Pro. Why I cannot open files and the screen asks for serial number?

    my account is active and paying per month for Acrobat Pro. Why I cannot open files and the screen asks for serial number?

    I don't work for Adobe but it seems to me you might be signing in to Acrobat with the wrong Adobe ID.
    Check the Adobe ID you use in Acrobat.
    Check this Adobe ID on Adobe's to make sure that it has an active subscription.

  • Problems uploading a text file with line feed characters from Windows

    Hi,
    I am using the FM GUI_UPLOAD to load a text file in which at the end of each line there is a line feed character. When I upload the file, the FM interprets the entire file as ONE record; it does not recognize the line feed character at the end of each file line. I am using the parameter in the FM "HAS_FIELD_SEPARATOR" and it does not do anything to remidiate this issue.
    The funny thing is that  WS_upload works like a charm and it separates every line in the text file according to the line feed character at the end of each file line.
    Why a FM that is obsolete would work better and with  less effort than the new one? We are on 4.6c and will go to ECC6.0 May 2009.
    Can anybody recommenced a way to process this type of file using GUI_upload?
    The file to process is downloaded from a bank Website into a Windows PC. Sending the file to Unix first is not an option.
    Thanks,
    Pierre Martinez
    Edited by: Pierre Martinez on Aug 15, 2008 1:09 AM

    Hi,
    I have done that and Notepad does NOT interpret the line feed character. The file looks all messed up. Notepad does NOT split the data into records. The Hex character at the end of each file line is 0A.
    The user will download the file into a Windows desktop from the bank's website and from there an ABAP  program needs to read it and parse it. But the ABAP  program can not even catch the entire file with gui_upload. WS_upload can catch it with no issues.
    I tried catching the file into an internal table of data type string using GUI_upload, but it only catches two bytes of the file and nothing else.
    I will try catching the file in some other type of data type for the internal table in gui_upload.
    Once I catch it, I can split the file by the line feed character. I need to catch it  first, but "my glove" is not big enough. Defining the internal table for the gui_upload as character is a guessing game since I really do not know how big the text file is since GUI_upload will put it in a one record.
    Thanks.

  • Opening files and viewing the text

    I'm trying to write a method to open a .doc file and display the text to screen, the program runs but nothing appears on the screen. Is the code below the correct way or is it flawed.
    class Open implements ActionListener
              public void actionPerformed(ActionEvent event)
                   try {
                   JTextPane view = app.setScreen();
                 BufferedReader in = new BufferedReader(new FileReader("outfilename.doc"));
                 String str;
                 while ((str = in.readLine()) != null) {
                 view.setText(str);     
            in.close();
        } catch (IOException e) {
         }

    I'm trying to write a method to open a .doc file and
    display the text to screen, the program runs but
    nothing appears on the screen. Is the code below the
    correct way or is it flawed.
    class Open implements ActionListener
              public void actionPerformed(ActionEvent event)
                   try {
                   JTextPane view = app.setScreen();
    BufferedReader in = new BufferedReader(new
    w FileReader("outfilename.doc"));
         String str;
         while ((str = in.readLine()) != null) {
         view.setText(str);     
    in.close();
    atch (IOException e) {
    Hard to tell why you aren't getting any output without more of the program.
    One thing I see is that this classes replaces the text of JTextPane with the last string read from the file. If the last string were a blank line then you would have nothing to show.
    If you are assuming this is a reasonable size document then you might consider appending each line read into as StringBuffer then set the text of the JTextPane to the contents of the StringBuffer after the reaches then end.

  • File adapter and line feeds

    Hi,
    we need to produce a flat file using the content conversion of the file adapter without any line feed (the target structure is a complex one with several record types).
    Example
    What we get now:
    *AAheaderA
    *ABheaderB
    *BAItem1
    *CAsubitem1
    *BAItem2
    What we need:
    AAheaderAABheaderBBAItem1CAsubitem1*BAItem2
    It seems that with NameA.endSeparator parameter you can only add a new character, but I need to delete the line feed.
    Is it possible with standard file adapter or do we need do create our own module with java?
    Thank you.

    Hi Stefano,
    So you Basically want to do content conversion at the receiver end and that is basically to get the entire data in one line.For that please go through these links below.It clearly explains your requirement.
    <a href="/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion Receiver with Content Conversion</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm">Converting File Content in the Receiver Adapter</a>
    carefully make a note of the "The ‘endSeparator’ parameter.
    Regards,
    abhy

  • JeditorPane text selection problem due to line feeds and carriage returns

    Hi folks,
    I have a jEditorPane (text/plain) that contains a document in which the user has highlighted some text. I want to pull the selected text from the pane, do some processing on it, and then put the altered text back in the same position.
    First I get the starting and ending position of the highlighted text
    int mySelStart = myJEditorPane.getSelectionStart();
    int mySelEnd = myJEditorPane.getSelectionEnd();Then I get all the text from the pane and (in theory) strip out the portion the user highlighted
    String myPaneText = myJEditorPane.getText();
    String mySelectedText = myPaneText.substring(mySelStart,mySelEnd);But the text string in mySelectedText never matches what the user originally highlighted. The starting and ending positions are off by the number of carriage returns that proceed the highlighted text in the document. It appears that while in the jEditorPane Java treats the carriage return as one characters, but once the info is in the myPaneText field Java treats the carriage return as two characters.
    Has anyone encountered this before? Am I doing something wrong? To fix the problem I'm looping through the entire document to find out how many carriage returns proceed the highlighted text, but there has to be an easier way.
    Thanks

    It appears that while in the jEditorPane Java treats the carriage return as one
    characters, but once the info is in the myPaneText field Java treats the carriage
    return as two characters.Correct on a Windows platform. Check out my posting here for a one line solution:
    http://forum.java.sun.com/thread.jspa?forumID=31&messageID=1464594

  • Find text from a file and set it as a variable in applescript?

    I am trying to build a script that sends me updates and notifications from cex.io. Please keep on reading below, so I may guide you until the point I have trouble with.
    The first simple script in this operation goes to cex.io's trading page for BTC/GHS. It records ands saves the text to a file every 4 seconds. It works great. It doesn't need to have safari refresh because the site pushes info to the browser live.
      repeat
              set the webpage_content to ""
              tell application "Safari" to set the webpage_content to the text of document 1
              set theText to webpage_content
              set a to "Macintosh HD:Users:PRIVATE:Desktop:CEX:"
              set theFile to (open for access file ((a) & "CEXRaw") with write permission)
              write theText to theFile
              close access theFile
              delay 4
      end repeat
    And it returns this from the site to this main file every 4 seconds: (note I cut off a chunk from the bottom and the top of the file, because they are unimportant)
        GHS:
        0.05233439
        BTC:
        0.00000223
        NMC:
        0.00002939
        LTC:
        0.00000000
        GHS/BTC
        0.02362958 LTC/BTC
        0.02438131 NMC/BTC
        0.00597565 GHS/NMC
        3.96951800 BF1/BTC
        1.67000000 Fund Account
        GHS/BTC
        Last price:
        0.02362958
        Daily change:
        -0.00018042
        Today's open:
        0.02381000
        24h volume:
        73812.35539255
    I now need an applescript to read that file, and return wanted values. But I'm lost on how to write it.
    It needs to find the number under BTC, and set it as a variable.
    It needs to find the number under GHS, and set it as a variable.
    It needs to find the number under Last Price, and set it as a variable.
    If anyone could script that really quick for me, or tell me how to do it, that would be amazing. Thank you so much!

    Couldn't tell if you had any whitespace in the lines (i.e. is there a space before or after GHS:), so I used contains, not is.  Also, if you have a line such as GHS/BTC with a colon GHS/BTC:  then it will also fail (as contains "BTC:" would be true for BTC: and GHS/BTC:)
    However, this will give you some guidance:
    set a to "Macintosh HD:Users:PRIVATE:Desktop:CEX:CEXRaw"
    set x to 0
    set Names to paragraphs of (read file a)
    repeat with nextLine in Names
              set x to x + 1
              if nextLine contains "BTC:" then
                        set BTC to item (x + 1) of Names
              else if nextLine contains "GHS:" then
                        set GHS to item (x + 1) of Names
              else if nextLine contains "Last Price:" then
                        set lastPrice to item (x + 1) of Names
              end if
    end repeat

  • Emacs opening files and lisp

    I have been playing around with emacs for the mac. I usually use it from the command line, but I would also like to use it from the GUI so I can get rid of the text editor and word. I have set it so that text files open emacs, but it opens emacs with the scratch buffer and not the actual file, how can I get emacs to open the file from finder?
    Does this have anything to do with the lisp directory/file? What is the lisp? I get the following message when I open files from the command line with emacs. I have set up the following alias
    alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'.
    "Warning: Lisp directory `/Applications/Emacs.app/Contents/Resources/share/emacs/site-lisp' does not exist."
    Thanks

    Hi Nils, I have tried both ways to open emacs, and the both work the same, they both give the same warning too. Thanks for the lisp link, I didn't realise the lisp is an AI programming language, I don't know if it is the same thing or not? I do know that my work computer (Mandrake Linux) has an extensive lisp file that contains all sorts of things that I assume tell emacs how to work ie, which syntax to highligh for a program language that I use at work, and how to integrate LaTeX etc. It does say not to blindly copy it too, so it probably won't work on my mac. I was wondering if anyone had any idea about how/where to create the lisp file, and what to put in it.
    Hi Don, I did look at that emacs, but I use the emacs on aqua one instead. I have just looked at it again, and it might be a better option. Do you know if there is a way to remove the icons at the top of the page? I don't like the appearance, thanks

  • How can I get the cursor's position in a opened file and display a menu?

    Hello,
    I want to make a program by which I will be able to display a panel/pops up menu at the corsor's current position, (In any text/doc file or in the desktop, we can display a menu by right click of the mouse.) Now I want my program to do the same task.
    More clearly-
    1. First I would save some words or sentences in a file(aa.txt).
    2. Then I would open another text file/ a word/ excel/ or any other editor( bb.txt / cc.doc / dd.xls / ee.html ).
    3. While editing or writing something in the opened file, if I click the right mouse button/ press a key (ctrl+space), a menu will appear containing the sentences I saved in the file(aa.txt) previously.
    My program will tell me the cursor's position in bb.txt / cc.doc / dd.xls / ee.html that i opened. And display a menu. my problem is not reading / writing in a file.
    My problem is how can I get the cursor's position in a opened file display a menu at that position by a mouse/key action*.
    Would you please help me on this regard.
    Thanks

    DrClap wrote:
    I think the OP wants to start up an application like MS Word and then operate it from a Java program.Doesn't The Monkey's Paw do that? What a second, according to Wikipedia:
    [http://en.wikipedia.org/wiki/The_Monkey%27s_Paw]
    <quote>
    ...the paw of a dead monkey is a talisman that grants its possessor three wishes, but the wishes come with an enormous price.
    The moral of the story is contained in this description of the paw: "It had a spell put on it by an old fakir," said the sergeant-major, "a very holy man. He wanted to show that fate ruled people's lives, and that those who interfered with it did so to their sorrow."
    </quote>
    So I guess that a non-sequitor ... or is it?

  • How to add text in .ai file and  set position, font, size and colour

    I want to place multiple lines of of text (individually) into .ai file and set size, font, colour and position for each.
    Preferably text should have origin in a single point (rather than be framed)
    Hope anyone can help me out.
    Thank you in advance.

    Here's what's in the Scripting Reference
    Creating and modifying text frames
    // Creates a document with text frames displaying path, area and point
    // text, changes the content of each frame then deletes the 2nd frame
    // create a new document
    var docRef = documents.add();
    // create 3 new textFrames (area, line, point)
    // Area Text
    var rectRef = docRef.pathItems.rectangle(700, 50, 100, 100);
    var areaTextRef = docRef.textFrames.areaText(rectRef);
    areaTextRef.contents = "TextFrame #1";
    areaTextRef.selected = true;
    // Line Text
    var lineRef = docRef.pathItems.add();
    lineRef.setEntirePath( Array(Array(200, 700), Array(300, 550) ) );
    var pathTextRef = docRef.textFrames.pathText(lineRef);
    pathTextRef.contents = "TextFrame #2";
    pathTextRef.selected = true;
    // Point Text
    var pointTextRef = docRef.textFrames.add();
    pointTextRef.contents = "TextFrame #3";
    pointTextRef.top = 700;
    pointTextRef.left = 400;
    pointTextRef.selected = true;
    redraw();
    // count the TextFrames
    var iCount = docRef.textFrames.length;
    var sText = "There are " + iCount + " TextFrames.\r"
    sText += "Changing contents of each TextFrame.";
    // change the content of each
    docRef.textFrames[0].contents = "Area TextFrame.";
    docRef.textFrames[1].contents = "Path TextFrame.";
    docRef.textFrames[2].contents = "Point TextFrame.";
    redraw();
    docRef.textFrames[1].remove();
    redraw();
    // count again
    var iCount = docRef.textFrames.length;
    Your are looking stuff with the pointTextRef.

  • File Server Role: Slow access for "opened files" and slow Explorer browsing

    Since we migrated our fileserver from Windows Server 2008 R2 to Windows Server 2012 we are facing two major problems:
    1. Opening files which are already opened by other users takes about 1 minute before the file actually opens. This is not only for Office files such as Excel and Word, but also for other (not office) files. Again, this problem only rises when the file(s)
    is/are already opened by another user. There seems to be a sort of "Lock" check time which is about 45 to 60 seconds.
    2. The other problem is browsing via Explorer through the network drive (all clients are Windows 7 clients). Half of the time there is some kind of "hick up" with displaying the results of the folder. I cannot figure out a patern, but if there
    is no "hick up" then browsing is very fast (also in the busiest times of the working day)... If there is a "hick up" the result can take about 50 seconds to display the content of a folder.
    I suspect the SMB implementation / settings of Windows Server 2012 which are causing the problems...
    Things I tried:
    1. Changed the Oplocks wait time to 10 seconds (which is the minimum). The result is that openening files does indeed go some faster (still taking about 45 seconds).
    2. Disabled SMB2: the result is that browsing is fast... Opening files does go faster. BUT: we are then facing other problems like some files are not able to open... This setting was, after getting a lot of complaints from the users, changed back to enabled
    SMB2.
    3. Within the NIC card properties I disabled "QoS packet Scheduler", "Link-Layer Topology Discovery Mapper I/O Driver", "Link-Layer Topology Discovery Responder" and IPv6 (as we only use IPv4).
    All above with not the promising results.
    The server is a dedicated (virtual machine on vSphere 5.1) fileserver.
    Please Advice since this is not workable, and we have postponed the migration of the fileserver for our aother location.

    Hi Dave,
    I suggest you disable all third party applications like Anti-Virus application to test if it could reduce the waiting time when accessing a file.
    Here are some related threads below that could be useful to you:
    DFS Slowness when Opening Microsoft Documents and Excel Spreadsheets
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/61ec9a99-0027-44cb-815c-0da9276c1c96/dfs-slowness-when-opening-microsoft-documents-and-excel-spreadsheets?forum=winservergen
    Opening files over network takes long time
    http://social.technet.microsoft.com/Forums/windows/en-US/c8ddb65f-8a17-4cee-afd4-dfc09e99d562/opening-files-over-network-takes-long-time?forum=w7itpronetworking
    opening folder or file takes over a minute on Windows 2008R2 File server
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/b9aa98c4-3ef7-4e6d-810d-6099e72b33f6/opening-folder-or-file-takes-over-a-minute-on-windows-2008r2-file-server?forum=winserverfiles
    Best Regards,
    Amy Wang

  • Close ALL open files and save jpg with jpg option

    Hi,
    I have some (a lot) of -jpg images to crop, and resize, while I have to do this one by one based on what portion of the image to crop, once done I need to close, and save them.
    To speed up the process I open several files, and do the crop&resize, and when finished I use "close all", and would like to avoid to confirm the "save" dialogue, and the "jpeg options" "image quality option" dialogue, having to say save, and the option set to a given value.
    Unfortunatelly I am not a coder, and didn't understand anything from the Javascript Scripting Reference guide.
    I found this
    app.docRef.close(SaveOptions.SAVECHANGES);
    here, I pasted it into ExtendScript, saved it, but when opening the script from file > scripts > browse it returns error 21 (undefined is not an object)
    Will you please kindly give me the script?
    Thank you

    Add this snippet to a script file.
    Load script file in PS scripts folder
    Restart photoshop
    Assign keyboard shortcut to script
    #target photoshop
    //Make Photoshop the formost Appplication
    app.bringToFront();
    // Requires at least one open document
    while (app.documents.length > 0)
         //Save all open windows
        {activeDocument.close(SaveOptions.SAVECHANGES);}

  • Deleted the app in the dock that compiles all your open files and fans them out as icons. What is it and how do I get it back?

    When I bought my macbook pro, I deleted the app in the dock that complies all your open files together. When you click on the app it fans all the icons out. What is that app called and how do I find it again/get it back??
    Thanks!

    okay... got that...but before I deleted it, it would "fan" all my open web pages, or open PDF files. So they were in a little folder as opposed to lined up beside my trash bin?
    make any sense?

Maybe you are looking for

  • Why is my PDF size from my InDesign export still large?

    I'm doing class project that is a four-page, seven-image document with very little text. The project must be submitted as a PDF under 300 KB. However, when I export the document under the smallest file size preset and with the compression rates down

  • Update website without coding

    I made a website on dreamweaver whereby my client can blog and upload posts. Is there a way I can do this where the client doesn't have to physically open up the file and add code posts in

  • Policy Violation Details: Background Dump Destination

    Oem grid control 10.2.0.1. I have this policy violation: Ensures that access to the trace files directory is restricted to the owner of the Oracle software set and the DBA group. Here is my folder permissions: [oracle@dbdev juk_dev]$ pwd /opt/oracle/

  • Hiding backend URL in BSP iView / connect via portal-server to backend

    wrong posting / folder.. pls delete.. Message was edited by: Mario Kölzsch Message was edited by: Mario Kölzsch Message was edited by: Mario Kölzsch

  • Can see entire library in iTunes but can't play any songs

    An exclamation mark "!" appears next to each song in my library. This happens seemingly arbitrarily- sometimes everything is OK- since I installed v 5.0. From what I can tell, the song list is not connecting to the song files...I have no idea why. Ha