Scanning a line and skipping white space

Hi,
Yea I need to scan I line which I already have, but how do I skip white space or turn that scanned line into one without white space in it,
I saw trim but doesn't that only take it off the begining and the end of the String?
Is there an easy why to either scan it skipping white space or get that scanned line into one without white space in it?
Thanks

One way is to use StringTokenizer with " \t\n\r" as the separator string.
StringTokenizer    tkzr = new StringTokenizer(str, " \t\r\n");
StringBuffer       result;
while (tkzr.hasMoreTokens()) {
    String    tkn = tkzr.nextToken();
    result.append(tkn);
String             answer = result.toString();

Similar Messages

  • C309g Scanned files are saved as thick black lines and thin white lines

    Hi there,
    I am able to scan the documents and see them briefly in the HPScan software but once I have saved them (.pdf or .jpeg) and tried to open them in any application, all I get is a file that consists of thick black lines spaced out with thin white lines.  Therefore whatever I scan is useless as it cannot be viewed in any way.
    I am running Mac OSX Mavericks and have run all the updates and installed the latest drivers.  Originally I was unable to save anything but after perfroming the updates I was able to save the scans but it triggered the black and white lines.  The printer is connected to a network via Ethernet.
    I tried scanning a blank white page but the output file is the same with the black and white lines.
    Please help.

    Hi @Pooly ,
    I have sent you a private message. If you are not sure how to check your private messages then this post has instructions that will guide you through the process.
    Regards,
    George
    I work for HP

  • How to extract ALL text on a line, including extra white space, from PDF?

    I have written my first scripts to parse thru PDF files and successfully locate the beginning and ending of text portions that I wish to copy/extract.  For example, one of the scripts reads thru PDF files and locates patterns that allow me to copy/extract a lengthy Title that spans several lines on the page.  My remaining problem is that sometimes the text I wish to copy/extract has tabs or lots of white space between the words, and I need to retain ALL the "white space" between words.  Basically, I am successful at using getPageNthWord(j, i, false) along with "Quad coordinate sets" to get a word-at-a-time for all the words on the multiple lines but it seems to be skipping over the tabs and extra white spacing beetween the words.   Another way to say this is that I need to extract/copy a full line at a time, including all white space, instead of being limited to just a word at a time. 
    Can anyone help me with an algorithm to extract/copy text, not just the words but also including tabs and other extra white space characters? Is there some type of Regular Expression I should be using, or maybe some additional parameter used for getPageNthWord that would retain all the extra white space?
    Thanks in advance,
    Ted L

    Did you try setting the bStrip parameter of getPageNthWord to false? It will
    preserve some of the whitespace, but not all of it.
    As far as I know, that's the only way to do it via a script.

  • Imported image and making white space transparent...

    I need to make the white space around an image transparent without having to use the clipping mask tool. In Freehand, you simply click a button and the white background disappears. I need to use that exact technique to hide the white background.
    How can I do this in InDesign?
    Thank you.

    There's quick, and there's right. They're rarely in the same space.
    To make a transparent background can be a complex and fussy process. While InDesign could include a general tool to do so, it would likely be inferior to actually making the image background transparent in a native image editing tool.
    I've found most such embedded features to be adequate only for low end work - e.g., they leave a background halo on the image, or a noisy edge, or other image problems. I really don't see it as a flaw or omission that ID forces you to use a proper tool to create the background transparency.

  • Help - ipod shows red lines and displays white screen?

    This is the 3rd Ipod Touch, 4th Generation, I've had in 2 years.  Something has been wrong with each one of them.  The one I have now is only 2 months old and unfortunately my Apple Care Warranty has expired, last month.  I was not allowed to purchase a new Apple Care warranty for the new Ipod, so basically I am stuck with another "lemon".  Here's the problem, this time.
    My Ipod shows 2 thin red lines which extend half way across the screen from left to right, upper left corner when holding Ipod vertically.  sometimes when turning the Ipod on, the screen is almost all white and I can barely see the time and "slide to unlock".  It always happens when I plug into power.  Also, the red lines flash bright white at times and then extend across the entire screen.  If I take a picture of it, (holding down power and home buttons) it looks normal.
    Has anyone else had such a problem?  Can anyone suggest a solution?  I'd like to take this to Apple and say, "What the heck?"  Is it policy to replace a defective product with one that they wouldn't sell in their store but is OK to give as a replacement?  I love my Ipod Touch, but this is extemely frustrating!
    IPod Touch, 4th Generation, IOS 6.0.1

    I have not seen that problem here before. Likely a hardware bproblem but
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    iOS: How to back up your data and set up as a new device
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar
    I'd like to take this to Apple and say, "What the heck?" 
    Do that but nicely
    Is it policy to replace a defective product with one that they wouldn't sell in their store but is OK to give as a replacement?
    No. The replacment is a refurbished one that should work like new.

  • Find and remove white space

    Hi,
    In Oracle, using SQL or PL/SQL, how can I find trailing white spaces (space, newline, carriage return, tab) and remove them?
    Thanks,

    If you are in Oracle 10g Regular Expressions do it nicely:
    UPDATE t1 SET c1 = REGEXP_REPLACE(c1, '[[:space:]]');
    This will remove any character considered 'space' and includes all those you listed. It also has the benefit of being portable across character sets (EBCDIC) and languages (other languages have their own space characters).
    Regards.

  • Odd blue lines appearing in white space on screen

    Yesterday I noticed some light blue vertical lines showing up all over the screen of my new 24" iMac. They're most noticeable in text fields and along the edges of browser windows on white screens, but occur in every application including the finder (even on dock icons). They appear in the form of tiny blue dots surrounding the cursor, and follow it all around the screen (so I know they're not burned in). Every once in a while they will go away, but this morning they came back. Has anyone else experienced this problem, and if so, what is the likely cause? While it is not a severe issue, it is still mildly irritating and I am hoping there is a way to fix it. Any help is appreciated. Thank you in advance.

    I have the same problem, has anyone found a fix for this?
    Yesterday I noticed some light blue vertical lines
    showing up all over the screen of my new 24" iMac.
    They're most noticeable in text fields and along the
    edges of browser windows on white screens, but occur
    in every application including the finder (even on
    dock icons). They appear in the form of tiny blue
    dots surrounding the cursor, and follow it all around
    the screen (so I know they're not burned in). Every
    once in a while they will go away, but this morning
    they came back. Has anyone else experienced this
    problem, and if so, what is the likely cause? While
    it is not a severe issue, it is still mildly
    irritating and I am hoping there is a way to fix it.
    Any help is appreciated. Thank you in advance.

  • When block citing single lines, the forum adds three lines of extra white space

    If I quote a single code line
    ... like this one ...
    then the editor will display it as expected, i.e. a single line surrounded by a border.
    But after I submit the post, three additional empty lines are appended.
    This looks ugly and it bloats the block quote.
    I just confirmed that the HTML code is not changed after submission. Apparently, the editor and the forum page interpret the "prettyprint" class in a different way.

    Hi,
    That's not the blockquote, that's the 'Insert code block'. The fixed width is actually by design though, there's no way you can shrink the minimum size.
    If I post a one liner, I edit the HTML to add in a single break (<br />) to at least move the single line into the middle of the box.
    Example:
    Get-ADUser -Filter *
    EDIT: Credit for the break trick goes to Max, but that account has been deleted, so I can't properly credit him.
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • Why would white space and line breaks in sql query increase runtime

    Using 11.2.0.3.0 on unix sprac server, 8 cpus 32 cores 12TB storage. We have 16 batch servers doing inserts and ~100 users doing mostly queries.
    We have a wierd issue,  we have a long query that takes 30 seconds to run 1st time then 10-20 secs every other time. Based on knowledge of DB we expected it to take a lot less.  Then a developer reformatted it by taking removing extra white space and line breaks.  all of sudden query takes 6 secs first time and 0.8 every other time.  we tripled checked to ensure they are identical and that only difference is white space and line breaks.  We tried it with SQLDeveloper, TOAD, SQLPLUS, from out desktops, appserver. we could reproduce it every time, with white space 10-20 secs without it 0.8 secs.  Query is 200 lines long with white space 30 without it.
    Why would having white space make such a dramatic difference?  because the query is longer eventhough its identical?  We checked parsing times, etc, no difference.  Is there some network setting, oracle parameter, sqlnet setting?  We spent hours looking on google and found nother
    Slow:
      SELECT grt_student.student_id                                                                                                                                                                                                 
    AS student_id,
      grt_student.last_name                                                                                                                                                                                                       
    AS last_name,
      grt_student.first_name                                                                                                                                                                                                      
    AS first_name,
      grt_buyerinstance.buyerinstance_id                                                                                                                                                                                            
    AS buyerinstance_id,
      grt_buyerinstance.buyerfamily_id                                                                                                                                                                                              
    AS buyerfamily_id,
      grt_buyer.buyerfamily_acronym                                                                                                                                                                                                 
    AS buyerfamily_acronym,
      grt_reporting_utls_pkg.convert_gmrt_battery(grt_buyerinstance.buyerfamily_id,grt_buyer.battery)                                                                                                                                
    AS battery,
    fast:
    SELECT grt_student.student_id 
    AS student_id,  grt_student.last_name
    AS last_name, grt_student.first_name   AS first_name,  grt_buyerinstance.buyerinstance_id   AS buyerinstance_id,  grt_buyerinstance.buyerfamily_id
    AS buyerfamily_id,
      grt_buyer.buyerfamily_acronym  AS buyerfamily_acronym,  grt_reporting_utls_pkg.convert_gmrt_battery(grt_buyerinstance.buyerfamily_id,grt_buyer.battery)   AS battery,

    Do you have some sort of horrific network connection between the client and the database such that it would take 8.5 seconds to transmit a few kb of SQL to the server?  That seems most unlikely.
    How are you determining the query plan?  Are you absolutely sure that both SQL statements have the same plan_hash_value when they are actually executed (not just when you generate a query plan without executing it)?  What are the differences in wait events when you execute the two?
    The sql_id will change when you add or remove whitespace.  There are various methods of modifying query plans that are tied to a sql_id.  My wager would be that you have a profile/ outline/ etc. that is not there for the reformatted one which is causing a query plan difference.  My next guess is that you have an accepted plan for the old statement, you haven't set up a process to let the plan evolve, and the reformatted statement starts with the plan that the old statement would get if you allowed the plan to evolve.
    Justin

  • XSL mapping of ARTMAS IDoc - carriage returns and white space

    Hi all. I have tried all sorts here and am completely stuck. I am mapping an article master ARTMAS IDoc using XSL mapping and an extra carriage return and white space characters are being added to the FIELD1 and FIELD2 fields of the E1BPE1MARAEXTRT segment and I don't know why! These fields contain all our bespoke field values joined together so they are 229 and 250 characters long respectively, which I think is related to the problem. The mapping program looks like this:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
    <xsl:template match="/">
    <ARTMAS04>
    <IDOC>
      <xsl:copy-of select="//ARTMAS04/IDOC/EDI_DC40"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MATHEAD"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARART"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARAEXTRT"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MAKTRT"/>
      <xsl:for-each select="//ARTMAS04/IDOC/E1BPE1MARCRT">
        <xsl:if test="(PLANT='D100') or (PLANT='D200') or (PLANT='D300')">
          <xsl:copy-of select="."/>
        </xsl:if>
      </xsl:for-each>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARMRT"/>
      <xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MEANRT"/>
    </IDOC>
    </ARTMAS04>
    </xsl:template>
    </xsl:stylesheet>
    I have a test IDoc going through this and the first 3 characters of the FIELD1 are "BIK". If I look at the source of the XML file, the problem area looks like this:
    <E1BPE1MARAEXTRT SEGMENT="1">
          <FUNCTION>004</FUNCTION>
          <MATERIAL>000000000000895649</MATERIAL>
          <b><FIELD1>
            BIK</b>      0  0.00 T                                    000000001CARRERA FURY 04 20"     CARRERA FURY 04 20" 2005092420040622    X                    00000000   20031104 00200406140000000000                    0.00 0000000
          </FIELD1>
    You can't really see it above, but there is a carriage return and 8 white spaces before the BIK. Where does this carriage return and white space come from?! Any help would be really appreciated - this is driving me crazy!
    Many thanks,
    Stuart Richards

    Stuart,
    I think I know the cause to your problem. I am not an XSLT programmer but based on searching this forum I found how I can acheive the carriage return at the end of my document. Your xsl statement is as follows:
    <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
    Change the indent value from yes to no. This should remove the carraige return. Hope this works for you.
    I actually need a carriage return and line feed on my document so I am still stuck. All I have acheived is the carraige return.
    Thanks,
    Jim

  • White spaces jumps on the top page between header and reprot body on middle of a large multiple pages report

    I have similar issue with the white pages on the SQL Server 2012 Report Builder
    3.0. I created a multiple pages invoice report based on
    XML data file, which contains about 80 pages per report.  The report runs good.  But when try the Print Layout ,(PDF file too) some white space happened on the top of report bodies among or after page 70th of the report combines with the First letter
    "R" of Invoiced Company Name. Such as:  "R Delivery Inc." or "Rock ..." , " Rose ..." " ,,," means  names continues. (The report is sorted with Company name, and company ID). After "R". 
    (The page # changes based on the "R" name s position in the report), and the white space happens before "R" and jump up and down after. When the Other Letter shows up such like "S", the report text position goes normal until the
    end of report, the white space will be gone after "R".   I tried all methods those I could find online to reset the page margins, page breaks, LTrim, RTirm Company names, setting of page breaks.  So far all the method meet "R"
    will be no cure. (Even I set page break between each instance of a group, company names as “Rock...” and “Rose...“ are still set on same page.   I am wondering, does the SQL Server 2012 Report Builder has pages limitation? Or The Letter "R"
    has some bugs hide behind?  Please help! 

    Hi Helen,
    As per my understanding, I think this issue is caused by width size is not appropriate in the report. To narrow down this issue, please make sure that Body Width + Left margin + Right margin <= (Page width).
    If the tablix is a matrix, because of the column group can expand to multiple columns, we should according to the following rule:
    Body Width + Extra expanded column width + Left margin + Right margin <= (Page width).
    Besides, please make sure there are no extra page breaks before each “R”. To check whether the issue is caused by the letter “R”, we can try to use another field to replace the Company Name field.
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to remove the white space the in Excel  output

    Hi All,
    I was working with Oracle Apps r12.
    We have developed a custom report using xml and the report output type is Excel. when ran the report it completed with normal and the excel output is generated,We have a column called Amount and its having a white space before the amount.
    So that we cannot able to do any aggregate function with that data.
    For example the column called Amount
    28523.20
    32569.00
    25369.25
    in excel the output is coming like this, So when we select this three column and try to do any aggregate function it not giving any value.
    I have tried Trim but its dos'nt works, because the values are already trimed.
    Can any one could help on this.
    Thanks & regards
    Srikkanth

    Hi All,
    solved.
    Using this link i have removed the white space in my rtf and the white space in excel has removed
    http://office.microsoft.com/en-in/word-help/show-or-hide-formatting-marks-HP005189641.aspx
    Regards
    Srikkanth

  • Extra White Space issue

    Hi, I am currently building a website in Adobe Muse, and am really enjoying it.  I have encountered a few differences between what I designed and what the site actually looks like and have been able to find solutions to all but one.  The home page has just a header and footer and an Adobe Edge Animation.  However, there is extra white space apearing underneath the animation (above the footer). Everything looks fine in the design mode, but even in preview there is extra space.  I tried uploading it to our ftp, thinking that might be the issue (as the animation doesn't show in the preview mode), but the extra space is still there.  I tried moving the Social media icons, thinking they might be causing it.  I have looked to see if maybe there is a text box, or empty shape that is causing the discrepency, but I can't find anything.  Any suggestions?
    Here is the screen capture of the design mode:
    Here is the screen capture of it in the browser:
    Any help would be greatly appreciated.

    Hi Razorcs,
    I have checked your file and the white space is coming from the page that you are calling in the iframe. I have seen that most browsers do not respond well, when the widht and the height of the iframe is specified in percent.
    As a fix you have to give manual width and height to the iframe and that should take care of it.
    For example, try something like 412px, which is the height of the edge content,
    Regards,
    Abhishek Maurya

  • 10.4.10 Mail white space in header

    Since upgrading from 10.4.9 to 10.4.10, the headers in Mail have about 20 lines of spurious white space, plus the field names (To: From: etc) are on separate lines from the field values.
    Changing Preferences>Viewing>Header detail does not correct the problem.
    Mail version 2.1 build 752.2

    Helvetica Fractions clash

  • Preview: How get rid of white space above/below screenshots?

    My objective is to be able to make a composite screenshot by opening several and arranging their images on top of each other without unnecessary white space at the bottom and top of each of the pictures.
    I did not have such top and bottom white space when I used Preview with Leopard 10.5.8 on an old G5, only now with Lion on a mid-2011 iMac.
    Your counsel, please?
    Respectfully, Norm

    When the white space artifact appeared above and below each screenshot even before pasting into a composite, I thought it might be corruption of a preference but trashing of the 4 Preview plist files in Users/me/Library/Preferences did not fix it. 
    Your thoughts, please?

Maybe you are looking for

  • IDVD unexpectedly quits and/or video freezes during burn

    Please help! I'm going crazy trying to get a completed video project burned onto DVD. I have three video programs (one is a slide show), all created in Final Cut Pro and saved as either Final Cut Quicktimes or Quicktime movies using H264 compressor.

  • How to cancel/reverse a reversal document

    Hi A user has by mistake entered the reversal reason as "05 - Accrual) which has resulted in the reversal entry being posted to the next period. This document need to be reversed in the original period. However the system (FBRA/FB08) does not allow t

  • How to make my own grid and perform a "snap to grid" effect?

    Hi! I am a newbie in flash and I am trying to create a puzzle like game (a chinese puzzle game called tangram). I am wondering what kind of functions should I use to create a "triangular" grid i.e. something similar to this ? http://img40.imageshack.

  • How to integrate four different avalable transactions????

    Hi I have to combine four different transactions- MB31, Ztransction, IQ02, Ztransaction in such a way that if any one of them fails, all the previous should be rolled back. Please suggest me what should i be doing. I have mb31 bapi but i cant proceed

  • Photoshop problem disabled GPU

    I have Adobe CS5. It won't work in 64 only 32. I got the message "Photoshop has encountered a problem with the display driver and has temporarily disabled GPU enhancements. Check the video adapter manufacturer's website for the latest software. GPU e