Advertisement
sak1b

MML_parse.rb

Dec 6th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. input = "NE : ALMS01_MSOFTX
  2. Report : +++ MSOFTX/*MEID:5 MENAME:ALMS01_MSOFTX*/ 2019-10-21 16:36:07+06:00
  3. O&M #3783551
  4. %%/*1879715857 MEID=005*/ADD LAIGCI: GCI=\"4700204ACFF14\",LAIGCINAME=\"CB8U23A\",MSCVLRTYPE=MSCVLRNUM,MSCN=\"8801801000070\",VLRN=\"8801801000070\",NONBCLAI=NO,LAICAT=GCI,LAIT=HVLR,BSCDPC1=\"H'000076\",CSNAME=\"CBEB8\",LOCATIONNUM=\"8801801000100\",E911PHASE=INVALID,IFROAMANA=NO,LOCNONAME=\"INVALID\",CELLGROUPNAME=\"INVALID\";%%
  5. RETCODE = 297020 This record already exists in the 2G LAI Information table [ADD LAIGCI]. Please enter a new value
  6. "
  7.  
  8. def parse_MML(data)
  9.  
  10. lines = data.split("\n")
  11. p lines.length
  12. my_array =[]
  13. lines.each_with_index do |line,index|
  14. if line.include? "RETCODE"
  15. my_array = line.split(" ")
  16. break
  17. end
  18. end
  19. p my_array[0]
  20. p my_array[2]
  21. my_array[2].to_i == 0 ? "Success" : "Failure"
  22.  
  23. end
  24.  
  25. z = parse_MML(input)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement