I need a method for ignoring empty lines

Hi to all,
i need a method for ignoring empty lines when my program reades a file like that
start of file
print "xoxox"
//ignore this line
println"xaxaxa"
//ignore this line
end of file
cheers

Are you having trouble detecting these empty lines? Or are you having trouble not processing them once you've detected them?
For the first case, you neeed to define "empty." I assumed it meant "containing no characters," and that's what the first solution shows. Your example looks like "empty" means "starts with comment characters."
For the second case, you ignore them by just not doing anything: read a line
if (it is not empty) { // by whatever criteria you define for "empty"
   do something with it
}

Similar Messages

  • I need badi method for

    hi
    when i enter a material quantity in pr and if it is not match with material quantity with po order i should get a error message.
    i need badi method for this with explonation.

    hi,
    BADI and BAPI
    hope this helps u,
    Arunsri

  • Need replacement method for FM: REUSE_ALV_GRID_DISPLAY.

    Hi
    i need a replacement method for FM: REUSE_ALV_GRID_DISPLAY from the class CL_GUI_ALV_GRID,
    kindly let me know if someone knows the solution for it.
    regards
    mano

    Method set_table_for_first_display, look at [ALV Grid Control (BC-SRV-ALV)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf]
    Regards

  • LMS3.2 - Need Customized method for cofig archive to particular device.

    Hi all,
        We are using Cisco works LMS 3.2 - Added around 400 devices and monitoring the same.  Facing a issue like while taking a configuration backup getting all devcie details and also CONFIG_ARCHIEVE Job is time consuming, because getting all device configurations. To avoid this we need to know the customized method to archive target particular device configuration in the LMS 3.2 .
    Can any one help on this...Thanks in advance.
    Thanks and Regards
    Ramprakash

    This is possible. You can schedule a Archive job for perticular devices to run periodically, like every 6 hours, daily, weekly or monthly.
    This can be done from :
    RME > Config Mgmt > Archive Mgmt > Sync Archive
    -Thanks
    Vinod

  • Need a method for importing Palm III data into a Palm Centro

    I just bought a Palm Centro (Verizon), with the expectation of importing data from my old Palm III.  From the Palm III Desktop, I exported Contacts, Calendar, Tasks, and Memos into separate folders (this was done on a Windows XP PC) and copied the resulting folders & files onto a flash drive.  But when I try to import these files into the Palm Centro desktop (on a new Mac Pro with OSX), the backup files are not in a "recognized format."  Does anyone have a process for reliably getting the Palm III data into the Palm Centro?  Also, is there an easy way to purge unwanted Contacts/Calendar events from the Palm Centro handheld?  With all the trial and error, its accumulating a lot of garbage.  Thanks...
    Post relates to: Centro (Verizon)

    Click on the following link for the upgrade guide on kb.palm.com
    http://www.palm.com/cgi-bin/cso_kbURL.cgi?ID=12926
    You will need to hard reset the Centro in order to clear out the Centro before sync'ing. Click on the following link for the hard reset procedure.
    http://www.palm.com/cgi-bin/cso_kbURL.cgi?ID=887
    Click on the following link for the support page for your devices on the kb.palm.com webpage.
    http://www.palm.com/us/support/centro/centro_vzw/
    http://www.palm.com/us/support/palm3/
    There are links on the pages to the user guide, troubleshooting, how to's, downloads, etc.
    You could try to export the data in each category in Palm desktop, save to the flash drive and import the data.
    Click here for the data export procedure.
    http://www.palm.com/cgi-bin/cso_kbURL.cgi?ID=36288
    Make sure you select "ALL" for the range during the export procedure. If you don't, it will only export the currently selected record.
    Post relates to: Palm i705

  • Empty line handling in sender fileadapter FCC

    Hi Al,
      How do we ignore empty lines in the fixed length file by using FCC?
    In my input file,i would be having emply lines at last and as per my curect FCC configurations,it is reading that emplty line also and due to this,message got failed in message mapping.How do we ignore this in sender file adapter?
    I do not want to change any mapping condition.

    Hi Rajesh,
    Just a short in the dark . There is a parameter by the name of NameA.keepIncompleteFields
    This parameter is only evaluated if you enter a value for NameA.fieldFixedLengths.
    ○       If you enter NO and the last field found in the structure is shorter than specified in NameA.fieldFixedLengths, processing is terminated with a corresponding error message.This is the default.
    ○       If you enter YES, the last field found in the inbound structure is transferred to the outbound structure, even if it is shorter than specified in NameA.fieldFixedLengths.
    Caution
    You use this parameter to control the behavior of the conversion routine for the last field in a structure.
    Use the NameA.missingLastFields parameter to define the behavior at runtime when the structure contains less fields or no fields (as in your case a blank line) in total that specified in NameA.fieldFixedLengths.
    Regards
    joel

  • SAPScript - controlled empty Line

    Hello,
    I have a Problem in a Sapscript: in den MAIN, between all items, we need to print an empty line to separate the items. The problem is, if at the end of the MAIN, after an item they is not enough space for this empty line, this line is printed automatically at the begining of the next new page. I want to avoid this empty line at the end of page. Is this possible?
    I have make test with "Protect" and "Endprotect", it's works but in this case, the new page is trigged and the complete last item of the page is printed at the next page. This is not a good solution because we lost to much place at the end of the MAIN.
    Is any other solution possible? It is possible to controll this empty line?
    Thanks for answer.

    Hi SaiRam,
    I have already try this, i think it's the same solution as yours and it doesn't work:
    (For the test, the empty line is replaced by variable, that's shows the page numers)
    /: DEFINE &SAV_PAGE& := 1
    /: IF &SAV_PAGE& NE &NEXTPAGE&
    /: &SAV_PAGE& = &NEXTPAGE&
    /: ENDIF.
    /: IF &PAGE& EQ &SAV_PAGE&.
       page = &PAGE&, nextpage = &NEXTPAGE&, save = &SAV_PAGE&
    /: ENDIF.
    Here an example of the result:
    Item 10
    page = 1, nextpage = 2, save = 1
    Item 20
    page = 1, nextpage = 2, save = 1
    Item 30
    page = 1, nextpage = 2, save = 2
    Item 70
    End-Of-Page
    New-Page
    page = 2, nextpage = 3, save = 1
    Item 80
    Item 90
    Item 100
    We see that the system doesn't have enough place after "item 70" to print the Page-Line, so it trigged a new page. Normaly, he doesn't have to print the Page-Line at the bottom of the line, but it doesn't work. I don't know how avoid the print of this line at the bottom of a page. On a New-Page, i wan't start the Print with an item-line and not with a Page-Line.
    Have I do something wrong?
    Thanks for your answer.
    Marc

  • When I open up an e-mail attachment a box pops up PRINT TO FILE below that line OUTPUT FILE NAME with an empty line for the file name vs. simply going to my default printer?

    when I open up an e-mail attachment a box pops up PRINT TO FILE below that line OUTPUT FILE NAME with an empty line for the file name vs. simply going to my default printer?

    Make sure that '''''Print to File''''' isn't selected in the native print dialog box ''(see screenshot below)'' middle-right, and make sure your Printer is selected at the top of that dialog box.
    ''I'm a little confused why an email attachment would need to go directly to the printer, but that's what you asked about.''

  • I have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    i have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Using those instructions you may also be able to select PayPal if that is allowed in your country.

  • Help:i need a code for making a new text file then adding 1 blank line

    i have done makng load, edit and save for a command line text editor. now my problem is, i dont know how to make a new blank text file and store it on the current directory. and i need to have that new text have 1 blank line with full of white space. help please.

    PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("NewBlankTextFile.txt")));
    pw.println("                                                                                                                                         ");
    pw.close();

  • Can SAP ignore blank lines in Excel when uploading the planning for PCA?

    Hi,
    We have launch planning on PCA in SAP. We are uploading the planning figures from an Excel-sheet via the standard function in SAP. The problem is that sometimes we get blank lines in the Excel-doc. When we upload with blank lines we receive an error. Can I somehow get SAP to ignore blank lines?
    Best regards
    Carl-Johan

    Well you can delete the empty lines in excel using the sort functionality and try it.
    Hope it helps..
    Thanks,
    Nandita

  • Which libary I need to import for Rectangle method

    Anybody else knows which file we need to import for Rectangle method
    Example:
    mc.startDrag(false, new Rectangle(40,50,50,60));

    Hi,
           create a new ActionScript file...
         and click the left top corner + sign.That menu having a all classes.......
    regards
    Kamal

  • Need help finding the default payment method for supplier site in R12

    I am using the following query to find out what the default payment method is for a supplier site.
    select pv.vendor_id ,
    pvs.vendor_site_id,
    iepa.ext_payee_id,
    ieppm.payment_method_code
    from ap_supplier_sites_all pvs
    ,ap_suppliers pv
    ,iby_external_payees_all iepa
    ,iby_ext_party_pmt_mthds ieppm
    where pv.pay_group_lookup_code = 'EMPLOYEE'
    and pv.vendor_type_lookup_code = 'EMPLOYEE'
    and pv.employee_id is not null
    and pv.employee_id =92584--p_person_id
    and pv.vendor_id= pvs.vendor_id
    and pvs.vendor_site_code = 'HOME'
    and pvs.pay_group_lookup_code <> 'ATTACHMENT'
    and ((pv.end_date_active is null) or (pv.end_date_active >= sysdate))
    and ((pvs.inactive_date is null) or (pvs.inactive_date>= sysdate))
    and pvs.pay_site_flag = 'Y'
    and pvs.vendor_site_id = iepa.supplier_site_id
    and iepa.ext_payee_id = ieppm.ext_pmt_party_id
    and ieppm.primary_flag = 'Y'
    and pv.segment1 = '131678'
    The problem is that I am returning two rows.
    I have gone in to the application and changed the default payment method from 'Check' to 'Electronic' and I am able to see the change on one of the records, however I am unable to determine how I'm supposed to narrow it down to just this record. I am pulling what hair I have left out!
    Please help.
    Chris

    Here is the generic query for some one who is faing problem like us.This query will return all the payment methods for all sites of a supplier
    SELECT ieppm.payment_method_code,ieppm.inactive_date
    FROM ap_supplier_sites_all assa,
    ap_suppliers ass,
    iby_external_payees_all iepa,
    iby_ext_party_pmt_mthds ieppm
    WHERE ass.vendor_id = assa.vendor_id
    AND assa.pay_site_flag = 'Y'
    AND assa.vendor_site_id = iepa.supplier_site_id
    AND iepa.ext_payee_id = ieppm.ext_pmt_party_id
    AND ass.segment1 = '10033' -- Supplier Number
    AND( (ieppm.inactive_date IS NULL)or (ieppm.inactive_date > sysdate)) ;

  • Need to know the best method for pattern matching

    Hi,
    I need a best a way to do the pattern matching with better performance
    for the following requirement.
    i need to search for a set of records as per the following requirements.
    1. The input string will be split into tokens with space as delimiter
    so if the user enters the text 'severe head ache',the tokens formed will be
    severe
    head
    ache
    2. The terms which contain exact match of the tokens formed should be fetched from the database
    (i.e)
    i. the token should appear in the term as such and no alpha-numeric character should be appended to it but a single space or any single non alpha-numeric characer is allowed
    ii. the token may occur anywhere in the string.(like start, end, middle etc.)
    iii. the term should contain all the tokens
    For ex. the following terms will be fetched for the above input
    1. patient has severe head ache
    2. severe, head ache are present
    3. leg pain "severe" #head pain
    4. pain, severe in head, leg
    But following terms should not be fetched
    1. severe leg pain - (it does not have the token 'head')
    2. headache severe and leg pain - (head is a part of the word headache)
    3. head67 severe pain - (head is a part of the word head67)
    Thanks

    How about Oracle Text? There's even a Text dedicated on this topic here.
    C.

  • Please Help : i need a RETR(download) method for FTP

    Hello everyone !!
    &#304; want to write ftpClient class to connect ftp server.i complete the some of the methods of the class.For example; in the following there is a upload method (stor )... i works fine !!
    Can u help the modify this method for downloading ( in ftp protocol = retr)
    I am not good enough in file operations..Please help me !!!
    public synchronized boolean stor(File file) throws IOException {
    if (file.isDirectory()) {
    throw new IOException("SimpleFTP cannot upload a directory.");
    String filename = file.getName();
    return stor(new FileInputStream(file), filename);
    * Sends a file to be stored on the FTP server.
    * Returns true if the file transfer was successful.
    * The file is sent in passive mode to avoid NAT or firewall problems
    * at the client end.
    public synchronized boolean stor(InputStream inputStream, String filename) throws IOException {
    BufferedInputStream input = new BufferedInputStream(inputStream);
    sendLine("PASV");
    String response = readLine();
    if (!response.startsWith("227 ")) {
    throw new IOException("SimpleFTP could not request passive mode: " + response);
    String ip = null;
    int port = -1;
    int opening = response.indexOf('(');
    int closing = response.indexOf(')', opening + 1);
    if (closing > 0) {
    String dataLink = response.substring(opening + 1, closing);
    StringTokenizer tokenizer = new StringTokenizer(dataLink, ",");
    try {
    ip = tokenizer.nextToken() + "." + tokenizer.nextToken() + "." + tokenizer.nextToken() + "." + tokenizer.nextToken();
    port = Integer.parseInt(tokenizer.nextToken()) * 256 + Integer.parseInt(tokenizer.nextToken());
    catch (Exception e) {
    throw new IOException("SimpleFTP received bad data link information: " + response);
    sendLine("STOR " + filename);
    Socket dataSocket = new Socket(ip, port);
    response = readLine();
    if (!response.startsWith("150 ")) {
    throw new IOException("SimpleFTP was not allowed to send the file: " + response);
    BufferedOutputStream output = new BufferedOutputStream(dataSocket.getOutputStream()) ;
    byte[] buffer = new byte[4096];
    int bytesRead = 0;
    while ((bytesRead = input.read(buffer)) != -1) {
    output.write(buffer, 0, bytesRead);
    output.flush();
    output.close();
    input.close();
    response = readLine();
    return response.startsWith("226 ");
    }

    Rather than fixing the code, may I ask why, when you are admittedly not good at Java I/O, you are trying to write an FTP client? Such things exist already and are free for your use.

Maybe you are looking for

  • RFC with VBA Help Needed.

    Hi. I'm preety new to RFCand but I have to challenge following topic: I need to call SAP transaction  MF42N from RFC. I want to pass the parametres from Excel spreadsheet or externat .csv or .txt file.  Can you please provide some example code. I kno

  • Where can I download Acrobat X from

    I Have key fro this version but cannot find where to download it from

  • Error in Fb60

    Hello Experts, I have checked the suggestions which was given in the forum for the similar thread,but was not helpfull. The error message is like this: Special G/L transactions of type A are not supported Message no. F5246 Diagnosis Special G/L indic

  • More help

    ok everything worked But when i opened it sayed erroe product.dll was not found. Any help?

  • Apple warranty denied to fix my mac.

    I'm using my Macbook air for 1 year only, in September 2013 there appeared lines on the right side of the screen, the lines are vertical and take about 1/5 of the whole screen.Sometimes closing the laptop helped them to disappear, so I though it happ