LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Blokwise ASCII Parser Node

    Employee
    Posted 09-15-2014 03:53

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rakhi

    I want to parse the folloeing data. The file is ascii file where the data are blockwise, For N (suppose N = 10) number of subscriber, there should be N number of block . Example is given below for two subscriber.

    Subscriber-987654366
    IMSI 405666456
    GPRS Y
    WWW Y
    portalNmS Y
    UTRAN Y

    Subscriber-987654890
    IMSI 405666123
    GPRS Y
    portalNmS Y
    VoLTE Y

    Please let me know , how could I parse it using lavastorm. At now my LAE version is 4.6 desktop versio.
    Thanks in advance.


  • 2.  RE: Blokwise ASCII Parser Node

    Employee
    Posted 09-15-2014 07:39

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: mgajdosik

    If the blocks are separated by two line feeds then you can use delimited node and use \n\n or \r\n\r\n as your record delimiter, for the field delimiter use something like @#$%^&*, which is not found within the file and then field name set for DATA.... This will read in every customer into single record, single field. From here you can add unique ID within filter, by having code like this:

    id = execCount
    emit *, id

    Then your next node would be expand from list using \n as delimiter. Then you can split the DATA into NAME and VALUE by using another filter node and this code:

    if DATA.strFind("-")>-1 then fields = DATA.split("-") else fields= DATA.split(" ")
    emit id, fields.getItem(0) as NAME, fields.getItem(1) as VALUE

    After this you can use Pivot node Data to Names, where you will set top three params as NAME, VALUE, id and you should be able to see the output as you wanted...

    Of course there are few dependencies on data, but this should be sufficient for you to provide you with guidline on how to approach parsing of such data.

    Marek