Sublime Forum

Trying to streamline analyzation of data

#1

I have a file consisting of about 2,000 lines of code, and will over the next year end up with multiple more ranging from 2,000-10,000 lines that all look something like this:

    intervals [20]:
        xmin = 30.92253933399418 
        xmax = 31.02761699883159 
        text = "[d\zh]" 
    intervals [21]:
        xmin = 31.02761699883159 
        xmax = 36.65640141106862 
        text = "" 
    intervals [22]:
        xmin = 36.65640141106862 
        xmax = 36.685050880990964 
        text = "[d]" 
    intervals [23]:
        xmin = 36.685050880990964 
        xmax = 37.521796787386464 
        text = "" 

What I’m wanting to do but can’t figure out is i need the xmin and xmax numbers only from intervals where the text contains content (In this instance i would not want the xmin or xmax from intervals [21] or [23]), to be put into 2 columns in an excel sheet.

In case my end goal is easier to achieve than I am making it out to be, I am ultimately wanting the difference between the xmin and xmax of each interval with a content-full text section.

Does anyone have any ideas how to do this?

0 Likes

#2
  1. Select text = ""
  2. Press Alt+F3 (selects all instances of the current selection)
  3. Press Right to reduce the selection to a single caret each.
  4. Press Shift+Up 4 times and Shift+End to select the entire block.
  5. Press Delete or Backspace.
  6. Select xmin = and press Alt+F3 again.
  7. Press Delete.
  8. Press End and Ctrl+j.
  9. Extend the selection to the right until you reach the xmax number.
  10. Replace it with whatever separator you want. For CSV, you can use ;.
  11. Ctrl+x to cut out these lines.
  12. Open a new view with Ctrl+n and paste.
  13. Unindent if necessary using Shift+Tab.
0 Likes