Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20554
    BobBailey
    Participant

    This may seem like a very trivial thing but…
    I have a text file that has labels down the left side and information beginning at col 70 down the right side. Sample below. Given everything else that EmEditor does including cook breakfast for me each day, I’m sure what I want to do is possible. I’m able to add a separator at col 70 but can’t figure out the rest of it. Here’s an example of the data:
    Device ID: 0
    Interface: RAID
    Device Capacity: 476937 MB
    Serial Number: WD-WCC2EET06341
    Model Number: WDC WD5000AAKX-75U6AA0
    Firmware Revision: 19.01H19
    (When I created the post there were lots of spaces following each colon, I noticed that after posting they were all gone. Sigh.)

    What I’d like to see:
    Device ID: 0
    Interface: RAID
    Device Capacity: 476937 MB
    Serial Number: WD-WCC2EET06341
    Model Number: WDC WD5000AAKX-75U6AA0
    Firmware Revision: 19.01H19
    (There is a tab following each colon in this area.)
    I clearly can figure out a way to do this with a small batch but I’ll have lots of these. I discovered the “insert tabs for spaces” function; what I need is the inverse. Or, maybe the ability to convert a separator into tabs.
    Thanks in advance…Bob

    #20555
    Stefan
    Participant

    To replace “one colon followed by one-or-more spaces”
    by “one colon followed by one tab character”
    use Regular Expression Search&Replace

    Find: :\s+
    Repl: :\t
    [X] Use Regular Expressions
     

     
    HTH?
     
    Example:

    FROM:
    Device ID: . . . . . . . 0
    Interface: . . . . . . . RAID
    Device Capacity: . . . . 476937 MB
    Serial Number: . . . . . WD-WCC2EET06341
    Model Number: . . . . . .WDC WD5000AAKX-75U6AA0
    Firmware Revision: . . . 19.01H19
    ( dots represent spaces here )
    
    TO:
    Device ID:->	0
    Interface:->	RAID
    Device Capacity:->	476937 MB
    Serial Number:->	WD-WCC2EET06341
    Model Number:->	WDC WD5000AAKX-75U6AA0
    Firmware Revision:->	19.01H19
    ( '->' represents a tab char here )

     
     

    #20556
    BobBailey
    Participant

    Thanks Stefan, It helped a lot.
    I have a limited repertoire of Regex that I use all the time s+ wasn’t in it before.
    …Bob

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.