Change UIComponent from fixed width to fit content

I have a custom alert box I wrote. It has an optional second button. I use the alert box in various ways which may or may not need the second button.
Previously I was creating and adding the button dynamically, but because flash is so slow I have to preload the alert with two buttons.
So there are always two buttons in this alert view. So if I have an alert with both an action button and a cancel button, then I have an alert with just a cancel button I want to hide the action button. However if I set the action button to hidden it still throws off the alginment of the cancel button in my HGroup because it's still taking up space even though it's not there. If I set the width of the action button to 0 then I am using a fixed with and whenever I need to use it again I will have to manually calculate the width of the button!! Is there a way to set the width to 0 then set it like it never had a width at all?
Hope this makes since!
Thanks.

Here is a different approach.  Set your actionButton.visible = false and actionButton.includeInLayout = false then you should be in good shape!
Cheers,
Dave

Similar Messages

  • Fixed width of SCN content

    After last redesign of SCN all the content is cca 990 pixels wide. This was a fashionable approach of web in 90's. For web sites like forums and blogs I would expect flexible width - people working on large displays like 1920px wide can use full screen and people working with blog as right-hand help column can use it too. Some problems like text behind right edge would dissapear by flex width, I think.
    Why fixed layout (I accept the fact it is more comfortable for dev and testing)?
    Regards,
    Pavol

    Pavol;
    I am referring today with combining quotes from an article that already was written around fixed width:
    http://webdev.entheosweb.com/2008/07/16/fixed-width-vs-liquid-layouts/
    Earlier today I tried to respond quickly, and did not refer to the article appropriately nor entirely. Most of the response below was a mix of that article; and comments from me in appropriate places with additional decisions we made as an SCN team.
    As you correctly state there are two types of layout that you can choose from : http://webdev.entheosweb.com/2008/07/16/fixed-width-vs-liquid-layouts/
    This article also discusses the fact that one is the fixed width layout and the other is the liquid/variable layout. The fixed width layout sets the width of the web page at a specific value, no matter how wide the vieweru2019s internet browser window is, whereas liquid  & variable width layouts adjust their width depending on the width of the visitoru2019s browser window. The choice between these two layouts is not always an easy one. In our SCN case we chose for the fixed.
    As they quote in the article : http://webdev.entheosweb.com/2008/07/16/fixed-width-vs-liquid-layouts/
    For those who do not know much about this : Fixed width layouts mean that you have a  predetermined width which you will design the rest of your web page around. The main advantage of this approach is that it gives you greater direction and control over the eventual organization of your web pages.
    Which layout you eventually choose will greatly affect the final look and feel of your web site, not to mention the functionality of the site. The ease with which visitoru2019s can scan through your site for relevant information and identify the content that they wish to find is almost always largely dependant on your choice of layouts. We have a lot of content on our website in many places, and unfortunately for you and also from a maintenance perspective we wanted to opt in this release for fixed width.
    I picked the the pros and cons of the fixed width from the article as they are widely known to most website designers.
    *Fixed Width Layout*
    Pros
    Pages that you design look exactly the same when viewed using any internet browser or operating system.
    Images and other non-textual objects will not overwhelm the textual content of the page, regardless of the size of the browser window or viewing monitor.
    The scan length of your pages stays constant no matter how wide the vieweru2019s browser window is.
    Cons
    Viewers using smaller browser windows or monitors to view the site will probably have to scroll horizontally to see the entirety of the page. This tends to annoy online som eof our visitors. However we know most of our users use IE or Mozilla and have larger screens ( more than 30% has 1024x) from Surveys we do.
    A large amount of whitespace is usually generated when viewers use large browser windows to view the site, resulting in wastage of otherwise useful space. Also, more vertical scrolling may be required than should be necessary.
    Font size changes can adversely affect the overall layout of the page. Large increases in font size can cause the layout of your page to become distorted, making it messy and unappealing.
    In short: We used to have both approaches, but in the new SCN design we choose to have the fixed width approach for now.  We weighed both pros and cons
    Scott Lawley of our SCN team compiled it for us and referred in an internal presentation around the pros for SCN for fixed width. here is a quick summary ( thanks Scott, have a nice vacation )
    Our SAP Corporate styleguide calls for a fixed width layout (see e.g. sap.com)
    We already implemented EcoHub with a fixed width layout. All our communities should try to have as much a unified presentation where possible
    All of CSO's screen designs are made for a 1024 resolution. They do not work that well with higher resolutions (in our older SDN approach, viewed at higher resolutions it looked sometimes very lackluster, the lines of text became so long that readability is decreased)
    On high resolutions the old SDN site became harder to navigate because you had a lot of screen real estate to cover if you wanted to move the mouse from right to left
    Using a fluid layout for us meant that we have to continue using table-based layouts which did not entirely fit with the image of the modern web 2.0 platform we wanted to convey.
    Most news blogs and major news sites (like e.g. nytimes.com) use a fixed width layout. According to this survey http://tinyurl.com/65yjcv
    Flash content does not easily scale.  New page layout may need to be considered to better support flash in th enear future for us.
    92% of the top 50 news blogs use a fixed layout.
    And last but not least there were also some more philosophical and functional differences that we weighed of from each other : news vs. community vs. product
    What we will do in the next few releases is allow the collapsable left hand navigation that then will help the vertical scrolling challenge you might infrequently have,
    Hopefully this answers your question
    Edited by: Marco ten Vaanholt on Dec 17, 2008 7:59 AM
    Edited by: Marco ten Vaanholt on Dec 17, 2008 8:02 AM

  • How can I convert my web page from a fixed width layout to a fluid grid layout?

    I'm taking a web design class (I'm using Dreamweaver CS6, btw)  wherein the professor started us out building our websites in a fixed width layout but now I want to change my site into a fluid grid layout. My "site" so far is just one long page, and I've already designed it with fluid grid adjustments in mind (most things are centered  in the layout) so it shouldn't need excessive tweaking.
    Is there a way to duplicate the site folder that holds my first page, re-open a new document in fluid, then copy the code in and tweak the width parameters for the different layouts?
    Did I just answer my own question? Help - I am new at this!!
    Thanks all,
    KC

    Herbert2001 wrote:
    A bit off-topic, but Osgood: have you ever used SASS or LESS? When you are building your own grid systems it can save you a tremendous amount of time, and it's a lot of fun.
    Take the following simple example - it generates all the 23 css classes automatically for a 12 grid system. And simply changing one variable allows you to create and calculate any number of columns!
    //variables
    $desktop: 1025px;
    $large-columns: 12;
    @media only screen and (min-width: $desktop) {
         //regular grid span classes
        @for $i from 1 through $large-columns {
            .span-large-#{$i} {
                width: percentage($i/$large-columns);
         // push classes
        @for $i from 1 through (($large-columns)-1) {
            .push-large-#{$i} {
                margin-left: percentage($i/$large-columns);
    No, not explored it yet, and may never....I don't know. I don't really make much money out of web design. It's becoming more and more difficult to find the desire to learn new techniques when the opportunities aren't really there to put them into practice on as regular basis as I would like.  I've got  a very good handle on css, php, html, jQuery - I'm not sure I want to add another layer at the moment, given I'm never quite sure how long I will continue to 'bang my head against the wall' . I'm getting to the stage where I keep asking myself do I really need the problems associated with learning new stuff to the point of being comfortable with it if the financial rewards at the end don't equate to the efforts of learning it.
    I don't really enjoy web development if truth is known. I come from a Graphic Design background which I much prefer but somehow got side tracked and pushed in this direction and there's no way back now, lol. Whilst I concede Web Development is much more exciting its also 100 times more complex/difficult and the skills needed are considerably more.
    Your example looks interesting and I should think I could pick it up reasonably easily given I work with php which uses variables on a similar basis.

  • Switching from delimited to fixed width and had to retype 115 column names

    Hi we run 2012 enterprise.  I just changed a delimited flat file over to fixed width and had to retype all 115 column names.  Is there a way to preserve at least some of what ssis already knows (eg col names) in the flat file connection when
    this kind of changeover is occuring?  

    Thx Mike.  I appreciate your help so dont take this the wrong way.  
    Lets be honest.  This kind of behavior and some of the others I've posted recently when it comes to switching in and amongst flat file formats (fixed,unicode,unnecessary data type conversion etc etc) in ssis cannot possibly be by "design". 
    You might think I'm arrogant but hear me out.  As a graduate from one of the better engineering schools in the US and having earned a BSCS from that school, my thinking is that even a first year college student would design this little part of
    ssis in a more flexible fashion.  And the sad part is that legacy mainframe technologies from way way back baked this kind of flexibility into their products without add ins.  SSIS is purportedly .net technology and as such should follow the
    most fundamental rules of OO which include flexibility and reusability. 
    We should be more careful about the term "by design".  I believe this is actually a limitation which I'm sure would have been dealt with had there been more time, money and experience invested.  One of my other posts cites a recommendation (from
    ssis) that displays along with one of these flat file errors and has something to do with dt_ntext.  But the recommendation actually doesnt work.  So are we going to say that a recommendation that doesnt work is also by design?  I dont think
    so.  By design infers "for valid reasons".   And I dont believe there are any valid reasons for this/these behaviors.   If there are , pls share.

  • Importing fixed width text from a .txt file

    I am really struggling to do in Numbers '09 something which I can do easily in Excel.
    I have a txt file containing plain text in fixed-width columns which I would like to import into numbers.
    I just cannot find a way to do it.
    I have tried using the Insert/choose menu item - but it won't take .txt files.
    I have tried to copy/paste the data, but it get's pasted into a single column.
    The data consists of many lines like this:
    Part Value Device Package Library Sheet
    A-IN JST-2.0-4 JST-2.0-4 JST-20M KMILLAR 1
    A-IN JST-2.5-4 JST-2.5-4 JST-25M KMILLAR 1
    A-IN JST-2.8-4 JST-2.8-4 JST-28M KMILLAR 1
    (and so on....)
    (Each column is an exact number of characters wide, but these forums make that hard to see due to the variable spaced fonts).
    How can I import this data into numbers?
    (Sorry, but I cannot get the data in any other format, such as CSV, the application which exports it only support fixed width colums with spaces for padding).
    Many thanks in advance,
    Kenny

    Here is a script treating the case of fixed widths values.
    --[SCRIPT fixedwidth_values_toTSV.scpt]
    Enregistrer le script en tant que Script : fixedwidth_values_toTSV.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    aller au menu Scripts , choisir Numbers puis choisir fixedwidth_values_toTSV
    Choisir un fichier texte.
    Le script détermine la largeur des différentes colonnes puis remplace les groupes séparateurs par des caractères TAB.
    Le résultat est passé dans le presse-paiers et est enregistré à la place du contenu initial.
    Vous pouvez alors
    (1) coller dans le document de votre choix
    (2) ouvrir le fichier texte modifié dans Numbers qui accepte sans broncher les ficiers .txt.
    Utilisation alternative : enregistrer le script en tant que Progiciel (Application sous 10.6.x)
    Glisser-déposer l'icône d'un fichier texte sur celle de l'application lancera le traitement voulu.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    Sous 10.6.x,
    aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
    puis cocher la case "Afficher le menu des scripts dans la barre des menus".
    --=====
    Save the script as a Script: fixedwidth_values_toTSV.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    go to the Scripts Menu, choose Numbers, then choose "fixedwidth_values_toTSV"
    Choose a text file.
    The script scan the file's contents to extract the width of every column then it replace the separator groups by TAB characters.
    The result is passed to the clipboard and is written in the original file.
    So you may :
    (1) paste in the document of your choice
    (2) open the modified text file with Numbers which is fair enough to do that.
    An alternate track is to save the script as an Application Package (Application under 10.6.x)
    Drag and drop the icon of a text file on the application's one will do the job.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2010/08/19
    --=====
    on run
    set un_fichier to choose file with prompt "Choose e text file…" of type {"public.plain-text"} without invisibles
    my commun(un_fichier)
    end run
    --=====
    on open (sel)
    set un_fichier to item 1 of sel
    tell application "System Events" to set type_ID to type identifier of disk item ("" & un_fichier)
    if type_ID is "public.plain-text" then my commun(un_fichier as alias)
    error "The file “" & un_fichier & "” isn’t a text file !"
    end open
    --=====
    on commun(le_fichier)
    set le_contenu to read le_fichier
    set le_contenu to "azer ertyuio wxcv dfghj
    qszaed dc fghj mlkjhgf nbvcxw
    aqwzsx edcrfv tg byhn aaaaaaa "
    set listedelistes to {}
    set plusgrandelongueur to 0
    set pluspetitelongueur to 999999
    set listelignesbrutes to paragraphs of le_contenu
    repeat with refd_uneligne in listelignesbrutes
    set maybe to contents of refd_uneligne
    set maybe2 to count of maybe
    if maybe2 > plusgrandelongueur then set plusgrandelongueur to maybe2
    if maybe2 < pluspetitelongueur then set pluspetitelongueur to maybe2
    copy my decoupe(maybe, space) to end of listedelistes
    end repeat
    set differencedelongueur to plusgrandelongueur - pluspetitelongueur
    set des_espaces to space
    repeat differencedelongueur times
    set des_espaces to des_espaces & space
    end repeat
    set largeur1 to 0
    repeat with refd_uneligne in listedelistes
    set maybe to length of first item of refd_uneligne
    if maybe > largeur1 then set largeur1 to maybe
    end repeat
    set liste_finale to {}
    repeat with refd_uneligne in listelignesbrutes
    set maybe to contents of refd_uneligne
    set maybe2 to text 1 thru largeur1 of maybe
    repeat while maybe2 ends with space
    set maybe2 to text 1 thru -2 of maybe2
    end repeat
    copy maybe2 to end of liste_finale
    copy text (largeur1 + 2) thru plusgrandelongueur of (maybe & des_espaces) to contents of refd_uneligne
    end repeat
    Enter the bigger loop *)
    set cest_Lafin to false
    repeat
    Deprieve the stored rows of the treated column's items *)
    set flag to 0
    repeat
    set flag to flag + 1
    set flag2 to 0
    repeat with refd_uneligne in listelignesbrutes
    if "" & character flag of contents of refd_uneligne is space then set flag2 to flag2 + 1
    end repeat
    if flag2 < (count of listelignesbrutes) then exit repeat
    end repeat
    repeat with refd_uneligne in listelignesbrutes
    copy text flag thru -1 of contents of refd_uneligne to contents of refd_uneligne
    end repeat
    Prepare the extraction of next column *)
    repeat with refd_uneligne in listelignesbrutes
    copy my decoupe(contents of refd_uneligne, space) to end of listedelistes
    end repeat
    Extract the width of the column to treat *)
    set largeur1 to 0
    repeat with refd_uneligne in listedelistes
    set maybe to length of first item of refd_uneligne
    if maybe > largeur1 then set largeur1 to maybe
    end repeat
    Extract the column's values *)
    repeat with i from 1 to count of listelignesbrutes
    set maybe to contents of item i of listelignesbrutes
    set maybe2 to text 1 thru largeur1 of maybe
    repeat while maybe2 ends with space
    set maybe2 to text 1 thru -2 of maybe2
    end repeat
    copy (contents of item i of liste_finale) & tab & maybe2 to item i of liste_finale
    try
    copy text (largeur1 + 2) thru -1 of maybe to item i of listelignesbrutes
    on error
    set cest_Lafin to true
    end try
    end repeat -- i
    if cest_Lafin then exit repeat
    end repeat -- bigger loop
    set le_contenu to my recolle(liste_finale, return)
    set the clipboard to le_contenu
    set eof of le_fichier to 0
    write le_contenu to le_fichier
    end commun
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local oTIDs, t
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end recolle
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) vendredi 20 août 2010 12:44:33

  • Change background colour of full screen slideshow when set to fit content proportionally

    I've signed up for a demo of Muse and must say I'm very impressed. Having used Dreamweaver in the past at Uni, often getting bogged down in code, Muse is a designers dream. I've even told some friends about it, describing it as "InDesign for web designers". The features, and tutorials on Adobes site, are fab however I'm now needing a bit of assistance.
    I'd like several images to fit the whole screen on a specific section of my Muse website, right under the navigation bar. I've noticed the easiest way to do this is create a full screen slideshow. With this option I can add one, or multiple, pictures to fade in and out - communicating various messages and selling points. By default the widget options are set to Fill Frame, which expands my graphic to completely fill the browser. Unfortunately with this selected the image loses some quality and seems to zoom in, getting cropped in the process. When changing the settings to Fit Content Proportionally everything looks great. The graphic is smack bang right under my navigation like I desire however there is also a ghastly grey box either side because the graphic is now it's original size. The grey on either side seems to be the slideshow background colour but I am unable to figure out a way to alter this - from grey to black. Please see the link for more info: https://dl.dropboxusercontent.com/u/50403221/Screen%20Shot%202014-08-14%20at%2018.00.34.pn g
    Would any fellow Musers know of a way to get round this? Or perhaps should this be an enhancement request?
    Thanks, Chris

    Hi Chris,
    Can you select the slideshow widget that you have added and check the fill color in control panel.
    Please refer to the following screenshot :
    Regards,
    Akshay

  • When I send or receive e-mail, the mail gets changed significantly from its' original form.....typestyle, size of letters, symbols, page layout, color, everything changes.....is there a way to fix that?.....

    When I send or receive e-mail (Thunderbird).....the mail gets changed significantly from its original form.....typestyle, font size, symbols, page layout, color.....everything changes.....is there a way to fix that so my the original form of the mail is not changed?.....

    Just to recap, this is a collection of ports I have collected over time for people who needed this information when setting up the HP ePrint app so that they could view their email from within the app.  I am certain other applications also need this information.  Although lengthy, I could not find a more comprehensive place to retrieve this information.  Feel free to post additional information, faulty information, or other related topics below as this is simply a collection of data and it would be practically impossible to test all of them. Thank you!
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • How can i change standard font and fixed-width font in ipad 2?

    i need to change standard font and fixed-width font in my ipad 2, but i can not find safari setting menu. it is alower me to change that?

    Sorry, the font is not user selectable in Safari on iPad, like it might be on a desktop.  You can change the font size, but not the actual font.

  • Out of memory error - from parsing a "fixed width file"

    This may be fairly simple for someone out there but I am trying to write a simple program that can go through a "fixed width" flat txt file and parse it to be comma dilmeted.
    I use a xml file with data dictionary specifications to do the work. I do this because there are over 430 fields that need to be parsed from a fixed width with close to 250,000 lines I can read the xml file fine to get the width dimensions but when I try to apply the parsing instructions, I get an out of memory error.
    I am hoping it is an error with code and not the large files. If it is the latter, does anyone out there know some techniques for getting at this data?
    Here is the code
       import java.io.*;
       import org.w3c.dom.Document;
       import org.w3c.dom.*;
       import javax.xml.parsers.DocumentBuilderFactory;
       import javax.xml.parsers.DocumentBuilder;
       import org.xml.sax.SAXException;
       import org.xml.sax.SAXParseException;
        public class FixedWidthConverter{
          String[] fieldNameArray;
          String[] fieldTypeArray;
          String[] fieldSizeArray;      
           public static void main(String args []){
             FixedWidthConverter fwc = new FixedWidthConverter();
             fwc.go();
             fwc.loadFixedWidthFile();
            //System.exit (0);
          }//end of main
           public void go(){
             try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                Document doc = docBuilder.parse (new File("files/dic.xml"));
                // normalize text representation            doc.getDocumentElement ().normalize ();
                System.out.println ("Root element of the doc is " +
                     doc.getDocumentElement().getNodeName());
                NodeList listOfFields = doc.getElementsByTagName("FIELD");
                int totalFields = listOfFields.getLength();
                System.out.println("Total no of fields : " + totalFields);
                String[] fldNameArray = new String[totalFields];
                String[] fldTypeArray = new String[totalFields];
                String[] fldSizeArray = new String[totalFields];
                for(int s=0; s<listOfFields.getLength() ; s++){
                   Node firstFieldNode = listOfFields.item(s);
                   if(firstFieldNode.getNodeType() == Node.ELEMENT_NODE){
                      Element firstFieldElement = (Element)firstFieldNode;
                      NodeList firstFieldNMList = firstFieldElement.getElementsByTagName("FIELD_NM");
                      Element firstFieldNMElement = (Element)firstFieldNMList.item(0);
                      NodeList textFNList = firstFieldNMElement.getChildNodes();
                      //System.out.println("Field Name : " +
                               //((Node)textFNList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      //fldNameArray[s] = ((Node)textFNList.item(0)).getNodeValue().trim();
                      NodeList typeList = firstFieldElement.getElementsByTagName("TYPE");
                      Element typeElement = (Element)typeList.item(0);
                      NodeList textTypList = typeElement.getChildNodes();
                      //System.out.println("Field Type : " +
                               //((Node)textTypList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      //fldTypeArray[s] = ((Node)textTypList.item(0)).getNodeValue().trim(); 
                      NodeList sizeList = firstFieldElement.getElementsByTagName("SIZE");
                      Element sizeElement = (Element)sizeList.item(0);
                      NodeList textSizeList = sizeElement.getChildNodes();
                      //System.out.println("Field Size : " +
                               //((Node)textSizeList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      fldSizeArray[s] = ((Node)textSizeList.item(0)).getNodeValue().trim();   
                   }//end of if clause
                }//end of for loop with s var
                //setFldNameArray(fldNameArray);
                //setFldTypeArray(fldTypeArray);
                setFldSizeArray(fldSizeArray);
                 catch (SAXParseException err) {
                   System.out.println ("** Parsing error" + ", line "
                      + err.getLineNumber () + ", uri " + err.getSystemId ());
                   System.out.println(" " + err.getMessage ());
                 catch (SAXException e) {
                   Exception x = e.getException ();
                   ((x == null) ? e : x).printStackTrace ();
                 catch (Throwable t) {
                   t.printStackTrace ();
          }//end go();
           public void setFldNameArray(String[] s){
             fieldNameArray = s;
          }//end setFldNameArray
           public void setFldTypeArray(String[] s){
             fieldTypeArray = s;
          }//end setFldTypeArray
           public void setFldSizeArray(String[] s){
             fieldSizeArray = s;
          }//end setFldSizeArray
           public String[] getFldNameArray(){
             return fieldNameArray;
          }//end setFldNameArray
           public String[] getFldTypeArray(){
             return fieldTypeArray;
          }//end setFldTypeArray
           public String[] getFldSizeArray(){
             return fieldSizeArray;
          }//end setFldSizeArray 
           public int getNumLines(){
             int countLines = 0;
             try {
                    //File must be in same director and be the name of the string below
                BufferedReader in = new BufferedReader(new FileReader("files/FLAT.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   countLines++;
                in.close();
                 catch (IOException e) {}    
             return countLines;
          }//end of getNumLines
           public void loadFixedWidthFile(){
             int c = getNumLines();
             int i = 0;
             String[] lineProcessed = new String[c];
             String chars;
             try {
                    //File must be in same director and be the name of the string below
                BufferedReader in = new BufferedReader(new FileReader("files/FLAT.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   //System.out.println(str.length());
                   lineProcessed[i] = parseThatLine(str);
                   i++;
                in.close();
                 catch (IOException e) {}     
                //write out the lineProcess[] array to another file
             writeThatFile(lineProcessed);
          }//end loadFixedWidthFile()
           public void writeThatFile(String[] s){
             try {
                BufferedWriter out = new BufferedWriter(new FileWriter("files/outfilename.txt"));
                for(int i = 0; i < s.length -1; i++){
                   out.write(s);
    }//end for loop
    out.close();
    catch (IOException e) {}
    }//end writeThatFile
    public String parseThatLine(String s){
    int start = 0;
    int end = 0;
    String parsedLine = "";
    int numChars = getFldSizeArray().length;
    //Print number of lines for testing
    //System.out.println(numChars);
    String[] oArray = getFldSizeArray();
    //String chars = oArray[0];
    //System.out.println(chars.length());
    //oArray
    for(int i = 0; i < numChars -1; i++ ){
    if(i == 0){
    start = 0;
    end = end + Integer.parseInt(oArray[i])-1;
    else
    start = end;
    end = end + Integer.parseInt(oArray[i]);
    parsedLine = parsedLine + s.substring(start, end) + "~";
    }//end for loop
    return parsedLine;
    }//End of parseThatLine
    I have tried to illeminate as many arrays as I can thinking that was chewing up the memory but to no avail.
    Any thoughts or ideas?
    Message was edited by:
    SaipanMan2005

    You should not keep a String array of all the lines of the file read.
    Instead for each line read, parse it, then write the parsed line in the other file:      public void loadFixedWidthFile() {
             BufferedReader in = null;
             BufferedWriter out = null;
             try {
                //File must be in same director and be the name of the string below
                in = new BufferedReader(new FileReader("files/FLAT.txt"));
                out = new BufferedWriter(new FileWriter("files/outfilename.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   //System.out.println(str.length());
                   str = parseThatLine(str);
                   //write out the parsed str to another file
                   out.write(str);
             catch (IOException e) {
                e.printStackTrace(); // At least print the exception - never swallow an exception
             finally { // Use a finally block to be sure of closing the files even when exception occurs
                try { in.close(); }
                catch (Exception e) {}
                try { out.close(); }
                catch (Exception e) {}
          }//end loadFixedWidthFile()Regards

  • How to fix width of plain text content control in Microsoft Word 2010?

    I try to make the simplest solution for my custom to modify current Word template without hard code anything except field name.
    As you can see above image, normally text field in Word is not fixed width control. So, it may affect document layout. Moreover, I want to add dotted line below all text fields in document template.
    Is there any possible solution that end-user can do in normal Microsoft Word 2010 application?
    PS. I will fill all controls with data from Microsoft Access.

    In PDF file, I can easily create fix-size absolute position field inside document template like the following document. In Microsoft Word, I cannot fix even the size of plain text field.
    PS. Nobody use table with fixed cell size as normal form (hard copy). I think Microsoft Word is really bad choice for creating any document template by end-user.
    Criticizing Word for not doing the same as some other application is hardly relevant. Have you tried word-processing with Adobe Acrobat?
    As for your PS, Word tables are ideal for the kind of thing you describe. Your assertion that 'nobody' does so is plain ignorance - it is a common practice. In my previous employment,
    many forms were created using Word tables. Before complaining Word is a 'really bad choice', you should learn how to use it.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Do anybody know how to change a PNG file from 1760 width by 1369 height to 800 x 600?

    Do anybody know how to change a PNG file from 1760 width by 1369 height to 800 x 600?

    Crop to 4x3 aspect ratio, then resize to 800x600

  • Fix ALV column width independent of content

    Hi All,
    I need to fix ALV column width independent of content. If I set the width of column as 10 and when the content is 20 characters long, the column expands to 20. I want the width of column to be fixed irrespective of content. I tried all properties available for ALV column and table but couldn't figure it out. We are on ECC 6.0 ENHP4. Any ideas how to achieve this.
    Thanks,
    Tom

    I believe that I have done this setting fixed layout to true, and then manually setting the column widths in the code.
    lo_model->if_salv_wd_table_settings~set_fixed_table_layout( abap_true )
    lt_alv_column_table = lo_alv_model->if_salv_wd_column_settings~get_columns( ).
    LOOP AT lt_alv_column_table INTO ls_alv_one_column.
    ls_alv_one_column-r_column->set_width( '90' ).

  • Powershell : change fixed width text to delimeter

    Hi All. I have a text file with fixed width column. i want to change it to file with delimeter. is it possible ??
    col1      col2         col3
    Name1 Name2     Name3
    NameA NameB     NameC
    change to
    Name1,Name2,Name3
    NameA,NameB,NameC

    Hello,
    the Windows Powershell forum will be here
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell
    Best regards
    Meinolf Weber
    MVP, MCP, MCTS
    Microsoft MVP - Directory Services
    My Blog: http://blogs.msmvps.com/MWeber
    Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    Twitter:  

  • Is there a way to change fixed width Flat file connection manager to delimited without losing all the column names ?

    Is there a way to change fixed width Flat file connection manager to delimited without losing all the column names ?

    Unfortunately not as it is a quite dramatic change causing the metadata being refreshed. I would try to open though the package file in a text editor and find them before doing the change, then after you made the change to the FF connector try to reconstitute
    / replace the autimatically generated columns with the old names.
    Arthur
    MyBlog
    Twitter

  • I just changed over from Safari, and Firefox is incredibly slow! Are there ways to fix this?

    It's taking 30 to 60 seconds for Firefox to open any page. I just changed over from Safari, and this is about 10 times slower than Safari. Are there ways to speed up opening pages? I can't keep Firefox as my browser if it continues to be this slow. I have a Mac Mini, with Mac OS X as my operating system.

    You can try to disable IPv6.
    See http://kb.mozillazine.org/Error_loading_websites#IPv6

Maybe you are looking for

  • Parallel Processing : Unable to capture return results using RECIEVE

    Hi, I am using parallel processing in one of my program and it is working fine but I am not able to collect return results using RECIEVE statement. I am using   CALL FUNCTION <FUNCTION MODULE NAME>          STARTING NEW TASK TASKNAME DESTINATION IN G

  • IPhone 3G warranty replacement service NZ

    I have just experienced abysmal repair service for the iphone. It seems it is a New Zealand issue and I am interested to hear if anyone else has had similar experiences or whether this is just a one-off, bad-luck case? I bought my first iphone 3G out

  • How to define a global constant in OWB

    Hi, How can i define a global constant in a module, which can be used in all my mappings? ~Prabha

  • Removing Windows 8 from my MacBook Pro?

    Hello, I currently have windows eight installed on my partition. I want to uninstall it so I will be able to run it with parallel desktop. Parallel currently does not support Windows 8 from Bootcamp. My question is in order to erase windows 8 what fo

  • Expresion showing from stuff function in ssrs

    I have a table in sql server database, a column in it is made up using the stuff function, when i try to create a report in ssrs using the query, the column shows up like this <Expr1>, 1</Expr1><Expr1>, 2</Expr1><Expr1>, 3</Expr1><Expr1>, 4</Expr1> .