File Problem (getting line ends with \r\n)

I used readLine method     to read the line. It returns string.
I want to get the lined that ends with 0D0A ( \r \n ).
In the file in between there are many 0D. So my while loop
returns all the lines ends with 0D. But I need only the lines ending with 0D0A.
How can I differntiate these two types of lines
.....0D
...........0D0A
Is there any method in Java to differentiate these two lines.
reading char by char is time consuming process and it produce some overhead.
I think reading line by line gives the better solution
here is the code
import java.io.*;
class checkAcc {
public static void main(String as[]) {
try {
BufferedReader bf = new BufferedReader(new InputStreamReader(new FileInputStream("exa.dat")));
String s = null;
byte[] b;
while((s = bf.readLine()) != null) {
System.out.println("From Dat File ===> " + s);
} catch(IOException ie) {
System.out.println(ie);
Can any one pls give me the idea ...

That's the nature of readLine() my friend. The definition is as such:
Read a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.
There isn't anything wrong (performance wise) with using read() and processing it character-by-character.
tajenkins

Similar Messages

  • Problem creating line chart with character data

    Post Author: burkartt
    CA Forum: Charts and Graphs
    CR Developer v. 11.5.0.313
    I want to create a line chart with data from a SQL2K table to show how much server time each application uses per day. All data is defined a character.
    HWA,4/24/2007,01:44.6HWA,4/25/2007,12.28HWB,4/24/2007,4.6HWC,4/24/2007,55.55HWC,4/25/2007,01:22.3HWE,4/24/2007,01:16.1HWE,4/25/2007,0.59
    I want one horizontal line per application where the X-axis represents the date and the Y-axis represents the server time. I have tried all column combinations for "On Change Of" and "Show Value(s)". What confuses me is why are Count and Discount the only Summary Options for the "Show Value(s)" data?
    Thank you,
    tim

    Post Author: V361
    CA Forum: Charts and Graphs
    I created a group based on date, day, then created the chart and put it in the group footer, on change of server, show sum of time, you will get a seperate chart for each day.  I am not sure if this will help, or will just do.  Since you have CR XI, you may want to look at the gauge chart also....

  • Problem in Front end with BW3.5

    hi friends,
    now I am using BI 7.0 with front end BW3.5, it looks good. when i open the BEx, it didnot work...I think there is a component missing... If i use BI 7.0 as front end, I know that will be work.... I want to call BEx from citrix environment.... how can i find what component is missing, and how can we solve this problem...
    I want to get solution with BW 3.5 front end... please guide and help me....
    with hopes,
    Jaya
    Edited by: jaya durai on Jul 24, 2008 3:41 PM

    In the environment definition,
    -> External Application JDBC
    -> Properties
    -> Outbound JDBC Connection
    You have the database URL in the "DriverProperties" field
    Valid URL would be : jdbc:mysql://localhost:3306/caps
    !! The doc says that this field is optional !! Seems to be an error in the doc:
    Hope this helps
    Seb

  • Problems getting full sync with 4s

    When I sync my 4S with iTunes, each time it leaves out a great number of items (latest 100 items - always different items) that could not sync because "they could not be found".  I sync my iPad2 with no such difficulties.  Never happened before with my 3GS.  Has this happened to anyone else?  Is there a fix for it?
    And - part B - why do I have to do this at all if iCloud is enabled?  Although I do admit, I'm a little fuzzy on how iCloud works.
    Many thanks.
    Ellen

    Z-
    I figured it out.  You know how I also asked if anyone knew how to get rid of those pesky "_notes" folders?  Well, I was doing a board search for "_notes" and others have asked the same thing.  In my case, I had actually figured out a workaround (fire up Dreamweaver via a batch file, then have a Delete program delete all of the "_notes" folders after DW was closed down) but I didn't mention it at the time because I wanted to take the problem from the top.
    Well, one of the replies to the "_notes" problem mentioned that they also have something to do with keeping the local site sync'ed up with the web host.  Ah-ha!  I fired up Dreamweaver using the EXE (not the batch file), uploaded a new page, closed down DW, then fired it back up and rescanned the site.  Sure enough, the XML file in the _notes folder made the dif and DW didn't want to re-upload the file.
    All of which means either I can have the site stay in sync -- or I can deal with having a million _notes folders cluttering up the place.  I think I'll go with the former since I'd rather re-upload a few HTML files than have the place look like a junkyard.
    Thanks for the replies,
    Joe

  • Problem getting calendar event with recurring using EWS Java client API 1.2

    I am using EWS 1.2 Java client API for getting calendar events. I am able to get Recurring information of the event which is created through API's 
    appointment.save(), but not able to get recurring information of the event created in OWA interface, I get following error during the bind:
    ===================================
    Exception: Connection not established
    microsoft.exchange.webservices.data.EWSHttpException: Connection not established
    at microsoft.exchange.webservices.data.HttpClientWebRequest.throwIfConnIsNull(HttpClientWebRequest.java:394)
    at microsoft.exchange.webservices.data.HttpClientWebRequest.getResponseHeaders(HttpClientWebRequest.java:280)
    at microsoft.exchange.webservices.data.ExchangeServiceBase.processHttpResponseHeaders(ExchangeServiceBase.java:1045)
    at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:58)
    at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:144)
    at microsoft.exchange.webservices.data.ExchangeService.internalBindToItems(ExchangeService.java:1364)
    at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1407)
    at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1430)
    at microsoft.exchange.webservices.data.Appointment.bind(Appointment.java:70)
    at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:176)
    at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:152)
    ============================
    This happens if I use: Appointment.bindToRecurringMaster or Item.bind(service, id, appointmentProps) or findAppointments(). 
    Works fine for events which doesn't have recurring. Only issue with events containing recurrence created through OWA. These are the propertySet:
    new PropertySet(BasePropertySet.IdOnly,
                                    ItemSchema.Subject,
                                    AppointmentSchema.AppointmentType,
                                    AppointmentSchema.DeletedOccurrences,
                                    AppointmentSchema.FirstOccurrence,
                                    AppointmentSchema.LastOccurrence,
                                    AppointmentSchema.IsRecurring,
                                    AppointmentSchema.Location,
                                    AppointmentSchema.ModifiedOccurrences,
                                    AppointmentSchema.OriginalStart,
                                    AppointmentSchema.Recurrence,
                                    AppointmentSchema.Start,
                                    AppointmentSchema.End);
    If I remove Recurrence it gives the response. 
    Thanks.

    I am using EWS 1.2 Java client API for getting calendar events. I am able to get Recurring information of the event which is created through API's 
    appointment.save(), but not able to get recurring information of the event created in OWA interface, I get following error during the bind:
    ===================================
    Exception: Connection not established
    microsoft.exchange.webservices.data.EWSHttpException: Connection not established
    at microsoft.exchange.webservices.data.HttpClientWebRequest.throwIfConnIsNull(HttpClientWebRequest.java:394)
    at microsoft.exchange.webservices.data.HttpClientWebRequest.getResponseHeaders(HttpClientWebRequest.java:280)
    at microsoft.exchange.webservices.data.ExchangeServiceBase.processHttpResponseHeaders(ExchangeServiceBase.java:1045)
    at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:58)
    at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:144)
    at microsoft.exchange.webservices.data.ExchangeService.internalBindToItems(ExchangeService.java:1364)
    at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1407)
    at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1430)
    at microsoft.exchange.webservices.data.Appointment.bind(Appointment.java:70)
    at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:176)
    at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:152)
    ============================
    This happens if I use: Appointment.bindToRecurringMaster or Item.bind(service, id, appointmentProps) or findAppointments(). 
    Works fine for events which doesn't have recurring. Only issue with events containing recurrence created through OWA. These are the propertySet:
    new PropertySet(BasePropertySet.IdOnly,
                                    ItemSchema.Subject,
                                    AppointmentSchema.AppointmentType,
                                    AppointmentSchema.DeletedOccurrences,
                                    AppointmentSchema.FirstOccurrence,
                                    AppointmentSchema.LastOccurrence,
                                    AppointmentSchema.IsRecurring,
                                    AppointmentSchema.Location,
                                    AppointmentSchema.ModifiedOccurrences,
                                    AppointmentSchema.OriginalStart,
                                    AppointmentSchema.Recurrence,
                                    AppointmentSchema.Start,
                                    AppointmentSchema.End);
    If I remove Recurrence it gives the response. 
    Thanks.
    I am also facing the same problem.. If anyone can help, it would be helpful. I can see the response xml has the data, but while parsing the xml the error is generated in getResponseCode() in HttpClientWebRequest

  • Get lines starting with a specific word and export it in csv

    Hello,
    I have a text file of an application that sometimes goes in error.
    When the error occurs we have something like that:
    12/08/2013 21:36:15 - ERREUR     12/08/2013 21:36:15 - erreur open connexion : -2147467259 !! [IBM][CLI Driver] SQL30081N  Erreur de communication détectée.  Protocole : "TCP/IP".  API de communication
    utilisée : "SOCKETS".  Emplacement dans lequel l'erreur a été détectée : "192.168.1.15".  Fonction de communication détectant l'erreur : "selectForConnectTimeout".  Codes d'erreur spécifiques du protocole : "0",
    "*", "*".  SQLSTATE=08001
    12/08/2013 21:36:15 -  Machine : testVm
    12/08/2013 21:36:15 - ERREUR     12/08/2013 21:36:15 - erreur select repertoire : 3704 !! Cette opération n'est pas autorisée si l'objet est fermé. !! SELECT  distinct rep_inter, rep_transfert From exploit.rep WHERE  
    type_rep = 'E'   and machine = 'testvm' ORDER BY rep_inter,rep_transfert;
    12/08/2013 21:36:15 - ERR     12/08/2013 21:36:15 pb trait_repertoire
    12/08/2013 21:36:15 - Fin de session
    Yes, the message is in French :)
    That I need, is to read the file and search the ERREUR and then, include the message until the "Fin de session"
    (including the date and the hour that the error occurred).
    I tried this command: get-content .\error_Log.txt |Select-String "ERR" -SimpleMatch |
    export-csv .\ERREURS-$(Get-Date -Format dd-MMMM-yyyy-HH-mm-ss).csv
    But it is catastrophic!!!
    The output that i'd like to have is:
    DATE - HOUR - message error in three collumns of a CSV file.
    Note: In the middle of the message there is a BLANK line, it is normal.
    Any ideas will be welcome.
    thank you in advance.

    Hi,
    thanks for answering....your script does partially that I need.
    I explain: The output is in three columns but the error message is truncated, that is to say, I don't have the message entirely. To explain you, in the example above, when I generate the CSV file, the part ""192.168.1.15".  Fonction de communication
    détectant l'erreur : "selectForConnectTimeout".  Codes d'erreur spécifiques du protocole : "0", "*", "*".  SQLSTATE=08001"
    is missing...it goes directly to the line "12/08/2013 21:36:15 - ERREUR     12/08/2013 21:36:15 - erreur select repertoire : 3704 !!".
    Also that I need is to remove the double date-hour that appears in the same line.
    Thanks once again!

  • Writing in Files at the Line (END-1)

    I need to make my program write something not at the end of the program, but just before the last line. The basic idea is to have the word END at the end of the file, but when writing new things, I can either delete the things written before (which is not an option) or write at the end of the file, but then the new things I write will be below the end.
    Or, alternately, if there is a command which can tell the program to read the whole file, from top to bottom, that would be nice too.

    The best way to do that would be to retrieve all the text from the file into a String or StringBuffer object, and then append text at the places you want to append to.
    You can then take your modified String and rewrite over the existing text in the file.

  • Pages 5.2.2, every line ends with a quote mark

    Hello, hope someone can help with this problem.
    As soon as I start to type words in Pages, a double quotation mark appears after my words.  Can anyone advise how to stop this happening?
    If I type with invisibles on, the quote mark doesn't appear.
    Others in the office running the same software don't have this problem.  Is there something wrong with my setup?
    Thanks very much.
    Allen

    Pages v5.2.2 is an entirely different application than Pages ’09. Because it lacks over 100 features/functionality available in Pages ’09, it will quietly filter content from older documents that it doesn't support. That's one issue.
    Is anyone else in your office using the Interstate font with Pages v5.2.2, and the same OS X 10.9 release?
    Here are two simple things you can do, though I am betting on item 2 that will rebuild your system and local user font databases.
    Use Disk Utility to verify/repair your permissions
    Boot into Safe Boot Mode
    Shutdown
    At the boot chime, press and hold the shift key until you see a grey, horizontal progress bar
    At the login prompt, after you type in your password, and before you click the arrow to login
    Press and hold the shift key until you are logged in with the Finder menu bar showing
    Test Pages v5.2.2 with your Interstate font (things will be slower because of Safe Boot Mode)
    Reboot normally

  • Problem Getting 3D Sound With AWE64 Gold Card in DOS

    Hi,
    I cannot get 3D Sound to work with my AWE64 Gold Card in MS-DOS.
    In the C:>SB16 directory, I type CT3DSE to enable 3D Enhancement Technology but I receive the message, your card does not support 3D Sound Technology. I was able to activate it in the past and now I can't.
    I installed the DOS drivers from the AWE64 Gold CD - so incorrect drivers are not the issue here.
    Could it be that there's not enough free Conventional Memory to activate this feature? I have 510KB free.
    Can anyone help?
    Thanks.

    Mystery solved.
    There are at least two models of the AWE 64 Gold: The CT4540 and the CT4390. The 4540 does NOT support 3D Creative Enhancement Technology. The 4930 does. This may seem odd as one would expect the higher model to be more advanced.

  • Start up problems, get the circle with slash symbol then hangs forever

    I did a bad thing, I downloaded some software from the Internet. It was from Smith Micro. After the first re-start after installing, I had start-up problems with the "not allowed symbol" (a circle with a slash through it) coming after the Apple symbol then hanging forever.
    The Smith-Micro programs I down loaded were Spring Clean-up and Internet Clean-up. I have not used either program, just installed them.
    I have run Disk Utilities from my start-up disk, everything tested out perfectly. Tried a Safe Boot, computer started up but I couldn't do anything (useless for me). Tried to Zap P-RAM, didn't work. Tried booting in target mode, got a weird symbol ( can't even explain this one) and it just hung there. Unconditional reboot works, and I can use the computer like normal. Does the unconditional boot mess anything up. Should I use it from now on?
    I used the included uninstaller for both Spring Cleaning and Internet Clean-up, the computer still won't start-up normally.

    There's hardly any circumstance that requires the so-called "clean" install; it's a windoze-centric thing. Just reinstall, ensure that fixed the issue, then run Software Update. Snow Leopard's installer only replaces the OS components and basic Apple apps, such as TextEdit, Mail, Safari, Terminal, and Calculator, leaving *everything else* in place. In the future, always make a restorable backup before installing new stuff.

  • Problems getting a connection with WRT54G Ver. 8

    Okay.. This may be a little long.
    I had my router set up for about 2 years now. It worked fine up until 2 days ago. I have a WRT54G V8 router, with a Belkin wireless receiver for another desktop computer. I have tried using the 192.168.1.1 website to set up on my wireless computer to try and set up the IP address, but it does not seem to be working at all. The IP remains to be 0.0.0.0 and would not change after changing the MAC address, and using Release/Renew option. The desktop computer that the router is hooked up to doesn't even recognize 192.168.1.1 website into the browser. I have tried reconnecting the router, as well as the Broadband modem that we have and nothing seems to get the connection to my other desktop. Can anyone help me get my connection running again?  It would be greatly appreciate.

    Your Modem should be connected to the Linksys Router on the Internet Port and then you need to connect your Computer to the Linksys Router on the LAN Port 1.... Then Connect the Power to the Router.... Check the Light Status (Power, WLAN, Port no.1 and Internet) all this lights should be Lid...
    If your Internet Service Providor is Cable follow this link
    If your Internet Service Providor is DSL follow this link

  • Problem getting fullscreen resolution with MBP and Sony Bravia KDL-40W2000

    Hello,
    I usually dont post much on forums so sorry if my question is noobih but this time i think i need help so please bear with me. I have searched the web and read lots of posts without anything that helps.
    I recently got my new MBP 15 last week and wanted to watch a movie on my Sony Bravia KDL-40W2000 TV using XBMC.
    So i connected my MBP using the original Display port - DVI converter and then a DVI-HDMI converter. So my picture was connected to the HDMI port of my Sony tv.
    After a few adjustments on my Tv using pixel for pixel the best picture i could get was almost 85% of my tv which left me black edged. Using the OSX display setting i got 1080i so i also tested SwitchResX and got out 1080p (1920x1080) but the picture looked the same as 1080i,e.g i still had the black edges. Really cant understand why 1080p does not cover the whole screen to be honest, maybe someone have a good explanation?
    When i removed the display mirroring i got the full-screen but on the downside the desktop (on tv) looked somewhat zoomed in so i couldn't see the top-menu.
    I also played around with overscan but it did not help to remove it. Without overscan the picture gets even smaller on my tv leaving my with even bigger black edges.
    I cant figure out how to get the proper resolution on my tv.
    I hope someone with similar TV can help me out. Any other suggestion, ideas are more then welcome.
    ps. How does overscan option works anyway, is it not suppose to cover the whole tv screen? why does the picture get the black edges?
    Cheers
    /reza

    Hi OpenChannel...did u ever find an answer in the discussion boards. I have a 40" Bravia and was wondering if I could connect via DVI to HDMI cable.

  • Problem getting field names with OCI

    Hi,
    I am trying to retrieve the names of select fields through the
    OCI using OCIParamGet() followed by OCIAttrGet(). This seems to
    work OK, in most cases, except occasionally I get one field name
    concatenated to the following field name.
    Has anyone else seen this before, and if so, how do you get
    around it? Let me know if you need more details.
    Thanks in advance.
    Tim
    null

    That worked. Thanks!
    Peter Kls (guest) wrote:
    : Timothy Sim (guest) wrote:
    : : Hi,
    : : I am trying to retrieve the names of select fields through
    the
    : : OCI using OCIParamGet() followed by OCIAttrGet(). This seems
    to
    : : work OK, in most cases, except occasionally I get one field
    : name
    : : concatenated to the following field name.
    : Try evaluating the string length returned by the OCIAttrGet
    call.
    : The name string is not (always) \nul terminated.
    : : Thanks in advance.
    : : Tim
    : good luck
    : Peter
    null

  • Im getting tp ended with error code 0208

    I'm getting below error when selecting the system throguh solution manager how to solve this?

    Hi,
    Please check the below
    1. Transport directory permissions.
    2. Execute SM59->ABAP connections (TMSADM@<domain_controller>
    3. Go to System Overview->Highlight that system and click update configuration icon.
    4. Check /usr/sap/trans filesysetm/mount point is accessible in target.
    5. Check if "sapservice<sid>" being locked.?
    6. Try to check for parameters :- TPPARAM, TP_DOMAIN_[SID].PFL and tpparam_inst[SID]
    7. Finally rebooting the server will solve it temporarily.
    Regards
    Rishav

  • A new symbol appeared on my ipad. It has a lock in the middle of nearly complete circle whose line ends with an arrow. Any ideas what this symbol is?

    A new symbol has appeared on my ipad 2.  It resides to the left of the battery level indicator in the upper right corner.  It is a locked lock symbol with an arrow that forms an incomplete circle around the lock.

    If you see a lock icon in the upper right corner of the screen - then the screen orientation is locked.
    Try the side switch above the volume rocker first and see if that unlocks the screen. If that doesn't do it, double tap the home button and swipe to the right and look for the lock icon all the way to the left.

Maybe you are looking for

  • Very slow speeds with Mac Pro talking to a Ubuntu Raid Server

    So I have an environment where mainly macs and a couple Windows PCs use a Ubuntu Raid 50 file server. When attempting to access the server the Mac Pros take typically 1 minute to view the file structure and sometimes timeout, the Windows machines tak

  • Pushbutton on the application bar on an abap report

    Hello All, I need to have a pushbutton (labelled Download) on the application bar on the abap report screen . This button should enable me to download the report contents in a file format (like excel). Please can you guys help me acheive this.How sho

  • My Account Account Transactions does not show all transactions

    I set up a test Webtools site based on OEC Computers backend db and created a WT user linked to Account C41000. When logged in using this user I see that there are three transactions dated in 2005 on that account which did not come accross to WT in t

  • Custom Portal Services and Web services

    Can you please tell me what exactly are "custom portal services" and "web services" with a business like/ real life example? How do you go about developing deploying and utilizing these services in Portal? Thanks.

  • CS 5.5 is sloooow!

    Is CS 5.5 noticeably slower than CS 3? I just purchased upgradges for CS 3.0 to CS 5.5 for ten co-workers now I'm mad because I feel like I took a step backwards in speed. Everyone is running on MacPro tower and 10.6 or 10.5 and everyone is complaini