Help with string.split() for line breaks and spaces

What I'm trying to do is to take a series of numbers and convert it to a table, while cutting the numbers, aren't. Here's the format:

1.0000000E + 000 + 000 1.3668423e

1.0000000E + 000 + 000 1.3668423e

1.0000000E + 000 + 000 1.3668423e

...

So it is basically: space, space, digits, space, space, numbers, line break

Right now I am using the following code (myString is a string, and dataSet1 is an array):

var reg: RegExp = new RegExp ("\n");

myString = textLoader.data;
myString.split (reg) = dataSet1;

I tried ("\n\s") and ("(\n)(\s*)") and many other combinations, but I can't seem to figure out how to make multiple conditions in a regular expression. All I need to do is to remove all the spaces and line breaks and I should be good.

I appreciate any help, thanks.

You can use the Array.map method to convert your strings. Something like this:

function str2Num(element:*,_index:int,_arr:Array):Number
{
Return Number (item);
}

var arr:Array;

ARR = myString.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s + /);

ARR = map (str2Num, null);

or combine them all in a single statement

ARR = myString.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s + /) .map (str2Num, null);

Tags: Adobe Animate

Similar Questions

  • In v31.0, I can view is more 'raw' XML files with line breaks and ' < ' and ' / > ' characters. Is there a setting that will give me this option?

    Until a few days ago when I opened a file XML with Firefox, I see the content of the file appears with line breaks and ' < ' and ' / > ' and elements. Like this:

    fixed image in < typeOfResource > < / typeOfResource >

     <genre authority="marcgt">picture</genre>
     <genre authority="nmc">Print, Photographic</genre>
     <originInfo>
       <dateIssued encoding="marc">1884</dateIssued>
       <dateIssued encoding="marc">1884</dateIssued>
       <issuance>monographic</issuance>
     </originInfo>
     <language>
    

    Now, it will display like this:

     still image picture Print, Photographic 1884 1884 monographic eng electronic
    

    No tags or line breaks. I need to see the entire XML file. How can I configure FireFox to display this for me? One of my colleagues uses v31.0 and XML views with tags and the line breaks for him.

    For example, I was looking at files sitemap.xml (search Google for inurl:sitemap.xml). For those who have not declared a style sheet, you should always see the classic "source highlight: presentation

    Example: http://www.website.com/sitemap.xml

    Are the files that don't appear as similar planned by not declaring a style sheet?

    As a temporary workaround, you can view the source to see the original. Either:

    • CTRL + u
    • Right click > view Page Source
  • Newbie need help with string concatenation function.

    I'm totally new to LabView and am trying to work on a project that someone worked in the past.  I came to a string function concatenated on one of the existing provisions and only seen on some entries of the string function has an order of 'rel' and 'g '.  I don't know if it's a common command or what it is.  This is VI is that it requires a user to enter a base dimension (x-axis starting point and end point) and executes the steps in the sample desired within the "point of departure" and "end point".  "a3" is the name of the x-axis.  but I'm not sure of the meaning 'rel' and 'g '.  I posted part of the diagram.  Any help would be appreciated.  Thank you!

    This isn't a question of LabVIEW, but very specific to the device connected to the other end of the serial port. Do you have any documentation for it?

    Basically, the program needs form a consiting of command of a delimiter character, value and end of key word, etc. for example.

    Who wrote this program. It seems too complex and convoluted. Under certain conditions, it seems to send two commands at the same time, and there is no way to determine the order in which they run. Maybe it doesn't matter, but maybe it does. Most likely, what you need is a single structure dealing with a case for each condition and a unique series in the end writing. You can reach the actual program? There are also a lot of duplicate code. What is the purpose of the operations 1 x? Is this a Subvi?

  • Urgent need help with String Manipulation

    Hello;
    I really need help with strings.

    Let's say I have these channels:
    \\ABC\DEF\GHI\xyz\xyz\xyz\xyz

    \\ABC\DEF\GHI\xyz\

    \\ABC\DEF\GHI\xyz\xyz\xyz\

    \\ABC\DEF\GHI

    \\ABC\DEF\GHI\

    ABC/DEF/GHI/xyz/xyz/xyz/xyz

    ABC/DEF/GHI/xyz /.

    ABC/DEF/GHI/xyz/xyz/xyz /.

    ABC/DEF/GHI

    ABC/DEF/GHI.

    I need to convert them using a SQL statement for:
    \\ABC\DEF\GHI\xyz\ or //ABC/DEF/GHI/xyz/ according to the original management / or \. Please note that the "xyz" may be repeated zero or more times. I just need one end with a trailing / or -if she had one first.

    I'm on Oracle 11.1.6 SE. I have a bunch of attempts with instr, substr and replace, but I think that regexp_replace could be better.
    Any help would be GREAT! I have a whole team waiting on me.

    Hello.

    Here is a way.

    -----------------------------------------------------------------------
    with sample_table as
    (
         select '\\ABC\DEF\GHI\xyz\xyz\xyz\xyz' str from dual union all
         select '\\ABC\DEF\GHI\xyz\' from dual union all
         select '\\ABC\DEF\GHI\xyz\xyz\xyz\' from dual union all
         select '\\ABC\DEF\GHI' from dual union all
         select '\\ABC\DEF\GHI\' from dual union all
         select '//ABC/DEF/GHI/xyz/xyz/xyz/xyz' from dual union all
         select '//ABC/DEF/GHI/xyz/' from dual union all
         select '//ABC/DEF/GHI/xyz/xyz/xyz/' from dual union all
         select '//ABC/DEF/GHI' from dual union all
         select '//ABC/DEF/GHI/' from dual
    )
    select str,
         regexp_replace(str,'(xyz([/\])*)+$','\1') new_str
    from  sample_table;
    
    STR                      NEW_STR
    ------------------------------ ------------------------------
    \\ABC\DEF\GHI\xyz\xyz\xyz\xyz  \\ABC\DEF\GHI\xyz
    \\ABC\DEF\GHI\xyz\            \\ABC\DEF\GHI\xyz\
    \\ABC\DEF\GHI\xyz\xyz\xyz\     \\ABC\DEF\GHI\xyz\
    \\ABC\DEF\GHI                 \\ABC\DEF\GHI
    \\ABC\DEF\GHI\                 \\ABC\DEF\GHI\
    //ABC/DEF/GHI/xyz/xyz/xyz/xyz  //ABC/DEF/GHI/xyz
    //ABC/DEF/GHI/xyz/            //ABC/DEF/GHI/xyz/
    //ABC/DEF/GHI/xyz/xyz/xyz/     //ABC/DEF/GHI/xyz/
    //ABC/DEF/GHI                 //ABC/DEF/GHI
    //ABC/DEF/GHI/                 //ABC/DEF/GHI/
    

    Kind regards.

  • need help with my window is in thai and I do not understand to all.how to convert to English?

    need help with my window is in thai and I don't quite understand.
    How to convert to English? I tried for days but still it cannot be changed.
    because I can't read thai... Please help me step by step...

    my pc is touchsmart 9100 windows 7 Professional.

    Not a single word is in English if I go to the "region and language" to change.

    Everthing is in thai in the system.

    Hello

    Where have you bought the PC?

    What is the operating system installed?

    Best regards

    ERICO

  • I need help with an installation failure to interpret and troubleshoot a Setup log.

    Background: A few years ago, many editors of cinema used Final Cut Pro 6 (also contained in Final Cut Studio 2) for their editing projects.  Shared Apple Final Cut X uses a different format that is not compatible with FCP6.  Sometimes, these editors are called to work on a few historical projects that have been published in FCP6 and need this version to run now.

    Starting with OS X Lion, FCP6 would install not in Lion and thereafter.

    According research by Jeremy Johnston as noted on his blog, he discovered that Apple has inserted a file in the folder CoreServices in the Library folder of the system folder that causes versions the version Final Cut Pro X (and other older Apple programs in the same situation) do not settle.  He suggested changes to this file that would seek to prevent interfering with the installation of FCP6 in Lion, many users of final cut PRO 6 were successful in their efforts to install in Lion and work with it.

    Later in a discussion update on installing FCP6 in Mavericks, HawaiianHippie determined that the simplest way to perform the installation of FCP6 was simply copy this file and remove it from the system folder, install FCP6 and then restore the copied file:

    https://discussions.Apple.com/message/26309669#26309669

    I used this method with success to install FCS2 in Yosemite:

    [click on images to enlarge]

    However, in my attempts to install FCS2 in El Capitan, it fails in the last 5% to install the first DVD:

    First of all, I need advice on how to display an extremely large Setup log in this thread (on MacRumors, it is a method to insert a 'code' in a small box that can be the object of a scrollbar if necessary to read all along).  I am unable to find such a method to post here.

    Then once approved, I need help to determine which component is causing the installation to fail and perhaps this element can be omitted from the installation:

    If this element is not required, then maybe FCP6 can be installed successfully without it.  And if that omitted element is necessary, perhaps a manual method to install it can be determined by pacifists.

    It is my goal to help those who need to install and use FCP6 on their new Macs running El Capitan.

    Here is the post on MacRumors with pre-installed Setup log:

    http://forums.MacRumors.com/threads/i-need-help-with-an-installation-failure-to-interpret-and-troubleshoot-an-Installer-log.1954786/#post-22541389

  • virus: I struggled with the virus for some time and cannot get rid of them

    I have struggled with the virus for some time and cannot get rid of them. I bought a few programs, but they have also been infected. any suggestions for a really good virus buster.

    Hello

    First of all, an antivirus solution to an already infected system of loading is usually pretty useless. The bug will block all attempts to remove or load what it sees as a threat. Second, without knowing which virus you are affected by, it is difficult to be precise.

    You can take action include:

    (a) work in safe mode, there is much less likely that the virus is able to load and resist actively.

    (b) the safe mode, run utilities malwarebytes.org and AV solution that was installed * before * your infection.

    (c) post is back with a better description of what is on your system to learn more targeted advice.

    Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org

  • I am currently working on a site that has the integration of Paypal which includes the page redirects (confirm or cancel). My goal is to have the implementation of site with a layout for desktop, Tablet and phone. My question is when I have a redirect pag

    I am currently working on a site that has the integration of Paypal which includes the page redirects (confirm or cancel). My goal is to have the implementation of site with a layout for desktop, Tablet and phone. My question is when I have a redirect page should I create a separate provision of the page for each device or just a provision of office that fits all three screen sizes? I hope that if the html page has the same name of the device (query) is automatically detected. Help with the help of Adobe Muse CC

    By Payal integration, you mean paypal html button? or etc payment gateway configuration? If this is a configuration of the gateway to your site domain name then a single page with any structure will work, but if you use the button code for all associated formats then you will need to create separate pages for all.

    Thank you

    Sanjit

  • HTMLEditFormat/HTMLCodeFormat with line breaks and newline

    I seeks to some user entered the information on the screen and hit my a problem of output formatting. If I use HTMLEditFormat(), I lose all the line breaks, but that Word wraps nicely. If I use HTMLCodeFormat(), I get line breaks, but the text isn't as word wrap, making some really large screens, even if I put the information in a table with specific to a specific width defined. Is there a way to get the best of both worlds? I need to be able to keep line breaks (sometimes they seized lists or have several paragraphs) but want to word wrap too so that it is easy to read without scrolling sideways. Any ideas?

    Thanks for your suggestions. Given that the information is entered by external users and displayed to the public, I use HTMLEditFormat and HTMLCodeFormat to help prevent script attacks, so don't really want to drop them altogether. However, I discover after playing with the suggestion listed here, it will work: #Replace (HTMLEditFormat (mytext), chr (10),')
    (', 'all') #.

    HTMLEditFormat gets rid of the carriage return character, but not the line supply, so it is possible to replace line breaks with
    to create the desired effect.

    Thanks for your suggestions.

  • Need help with instr/Regexp for the query

    Hi people of Oracle

    I use Oracle

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    I have a few responses from students and the valid values are + / / (alphabet) o/p and spaces at the end of the scam only not in the middle.

    According to my condition, the registration number 2 3.4 must be in the request but I'm alone (chart 3).

    Can we use REG_EXP

    Help, please.

    Thanks in advance.

    Rajesh

    with x as)
    (
    SELECT '+-+-POPPPPPP' STUDENT_RESPONSE, 1 numero_enregistrement FROM DUAL Union all the
    SELECT ' + --AOPPPPPP++' STUDENT_RESPONSE, 2 numero_enregistrement FROM DUAL Union all the
    SELECT "+-+-OPPPPPP -' STUDENT_RESPONSE, 3 numero_enregistrement FROM DUAL union all
    SELECT '+-+-9OPPPPPP' STUDENT_RESPONSE, 4 numero_enregistrement FROM DUAL)
    )
    (SELECT NUMERO_ENREGISTREMENT,
    TRIM (STUDENT_RESPONSE) X
    WHERE
    ((INSTR (UPPER (TRIM (STUDENT_RESPONSE)),'-') = 0))
    OR (INSTR (UPPER (TRIM (STUDENT_RESPONSE)), '+') = 0)
    OR (INSTR (UPPER (TRIM (STUDENT_RESPONSE)), 'O') = 0)
    OR (INSTR (UPPER (TRIM (STUDENT_RESPONSE)), 'P') = 0)
    OR (INSTR (UPPER (TRIM (STUDENT_RESPONSE)),' ')! = 0)
    )
    )

    Hi, Renon,

    Rb2000rb65 wrote:
    Hi people of Oracle

    I use Oracle

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    Thanks for posting this (and the WITH clause for sample data). It is very useful.

    I have a few responses from students and the valid values are + / / (alphabet) o/p and spaces at the end of the scam only not in the middle.

    You combine several qeustions responses in a single VARCHAR2 column? It would be better to have a separate line for each question.

    According to my condition, the registration number 2 3.4 must be in the request but I'm alone (chart 3).

    What exactly are your needs? You try to find the rows where the student_response contains one of the forbidden characters, or if it contains a space anywhere, but at the end of the string?

    Can we use REG_EXP

    Yes, but it's pretty easy and probably more effective, do not use regular expressions in this case:
    Here's one way:

    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     TRANSLATE ( UPPER ( RTRIM (student_response, ' '))
                , 'X+-OP'
                , 'X'
                )     IS NOT NULL
    ;
    

    In other words, once you remove the spaces and all occurrences of '+', '-', 'o' or 'P', then the forbidden characters are left, and you want to select the line, if there is one of these.

    If you really, really want to use a regular expression:

    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     REGEXP_LIKE ( RTRIM (student_response)
                  , '[^-+OP]'          -- or '[^+OP-]', but not '[^+-OP]'.  Discuss amongst yourselves
                  , 'i'
                  )
    ;
    

    but, again, it will be probably slower than the first solution, using TRANSLATE.

    Published by: Frank Kulash, October 17, 2011 13:05

    Published by: Frank Kulash, October 17, 2011 13:41
    What follows is a bit simpler that TRANSLATE:

    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     RTRIM ( UPPER ( RTRIM (student_response, ' '))
               , '+-OP'
               )          IS NOT NULL
    ;
    
  • Need help with strings

    How to turn the string myName myName_btn?

    And can you give a link or tell me where I can find the current manual for Flash CS4?

    Thank you

    var var1:String = "myName_btn";

    var var2:String = var1.split ("_") [0];

    and check the comments here:

    http://evolve.reintroducing.com/2008/10/24/News/Adobe-Flash-CS4-F1-help/

  • Help with this &amp; quot; for &amp; quot; loop...!

    Hello. I recorded an ArrayCollection collection on the desktop. When I read it in the application I get the problem that the ArrayCollection collection is now a collection of objects, not a collection of type 'Player' which is the class that represents each item in the collection ArrayCollection. Each player class has three properties of type string associated with it.

    I created a function to "grab" the elements of the ArrayCollection collection. It takes the ArrayCollection collection that has been saved on the desktop as the first argument and the 'player' class as the second argument and must return a typed ArrayCollection collection.

    Try to understand why he continues to launch a mistake... and if I need a second loop inside the first passing variables of objects of the element to the temp object.

    Thank you!

    private void typeCollection (object: collection, clazz: Class): ArrayCollection collection

    {
    var arr:ArrayCollection = new ArrayCollection();
    for each {(var point: objet de collection)}

    var temp: Object = new clazz()
    Temp = item;
    arr.addItem (temp);
    }
    Return arr; return the collection of table
    }

    Hello.

    The error I get is below...

    ArgumentError: Error #1063: inconsistency of Argument on Player() County. 3 EXPECTED, got 0. hand / typeCollection [C:\Documents and Settings\Utilisateur\Mes Documents\Flex Builder 3\main\src\main.mxml:108])

    108 is the line var temp: Object = new clazz();

    When you ask what clazz in... Clazz represents the second argument of the typeCollection function and the argument that is passed is the player class, which is a class in an external actionscript file.

    In fact I just to work. The problem was... I created the constructor function of the class player to accept three arguments (id, first name, family name)... and so new clazz() should have 3 arguments... I just changed the code below and it seems to work...

    If there is a better way happy to hear!

    Thanks for responding.

    private void typeCollection (object: collection, claz: Class): ArrayCollection collection

    {
    var arr:ArrayCollection = new ArrayCollection();

    var a: String;
    var b:String;
    var c:String;

    for each {(var point: objet de collection)}

    var temp: Object = new claz (a, b, c)
    Temp = item;
    arr.addItem (temp);
    }

  • Help with software updates for HP Officejet Pro L7500 Series

    Five updates have been identified as available when I used 'check the software updates' Solution Center.

    All updates failed to download. The updates are:

    Update critical HP product Assistant

    Critical update for HP memories disc creator

    HP update - security update

    Updated HP 4.0.12

    Update recommended to correct a problem with the sign up now product registration page

    TDA, since these updates are not required for your system and your printer that updates could not be installed on your system, however if you want to see what updates are available, then this is the web page to select your printer model, and then select your operating system and you can see the updates you need to update for your printer :

    link to select your printer model

    Once you click on the link above, you must click your series of model and then in the next page, click on drivers and software download link to see available software for your printer.

    Hope this helps you.

  • Help with EasyLink Advisor for WRT54GS

    OK, when I try to make it appear the EasyLink Advisor to my router it says need administrator privileges, and then under that it says that you must be logged on as a user with administrator privileges to change the configuration of the computer for home networks. The thing is, though, that I'm logged on as administrator. I've never had this message before. I learned about the EasyLink Advisor repeatedly to find the IP address and other things so I can connect my Xbox, iPod Touch wifi and stuff like that. But now it doesn't let me do anything. I used to have Windows Vista on my computer, but then I upgraded to Windows 7 and I think this is the problem because it started to happen after I upgraded. Help!

    Yes easy Link Advisor is not supported on Windows 7.  You don't need it anyway.  Just connect to 192.168.1.1 with empty user name, admin password and check the router itself.

  • Need help with the update for my 11 elements

    I have 11 items and just switch to the Canon 7 d Markii and shooting in RAW for the first time last night and the editor and organizer elements does not files because it does not acknowledge the BRUTE of the 'new '... device information I tried the update and he offered only a 7.4 update, where the 7 5 d Markii must at least a 8.7 update... How can I get the latest update if my program does not by itself? I DON'T like the way Canon program from the disk provided with the camera is set for RAW images, and I don't want to have to change all the RAW files to only align my items... I enjoyed how the older my camera RAW files were brought in Editor with the pop-up window which allow me to make changes to quick for photos before opening them in the editor... Yet once I don't like how the Canon window works for RAW images... Thanks for any help on this... Nicole

    Camera Raw 8.7 was introduced in PSE13. If your software is too old to be compatible. Yu have two choices:

    1. Upgrade to the latest version PSE14
    2. Converting your CR2 for Adobe (DNG) Raw and DNG files will work with PSE11

    The Adobe's DNG Converter is free, and you can batch process all of a file CR2 by selecting a source folder and destination folder.

    Download the latest DNG Converter 9.6.1 Mac | Win

Maybe you are looking for

  • I need a product key Microsoft Vista

    Hello I need a product key Microsoft Vista I don't have any disks or the original box and the label is unreadable,I have the serial number of the laptop if it is of any help.

  • Can not start my Qosmio - RSC Server is unavailable

    firstly my Qosimo has turn the thetime all Finally he did while I liked Internet Now when I try to start it tell me that the server of the CBC is not available and does not allow me to log in I tried the bootingit insafe mode, but get to the same poi

  • How can I change admisistrater on XP

    Have a new computer and I want to change myself admin rights. How can I do this

  • Guess the password

    Where can I find?  I am such a novice and need to know where I can get it!  I have an E1000. Dian

  • Vista: Windows has recovered from an unexpected shutdown

    Signature of the problem: Problem event name: BlueScreen The system version: 6.0.6002.2.2.0.768.3 Locale ID: 1033 More information about the problem: BCCode: d1 BCP1: 00000009 BCP2: 00000002 BCP3: 00000000 BCP4: B6E2A0E7 OS version: 6_0_6002 Service