- AuthorPosts
- December 28, 2015 at 1:12 pm #20554BobBaileyParticipant
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…BobDecember 29, 2015 at 12:30 am #20555StefanParticipantTo replace “one colon followed by one-or-more spaces”
by “one colon followed by one tab character”
use Regular Expression Search&ReplaceFind: :\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 )
December 29, 2015 at 8:01 am #20556BobBaileyParticipantThanks 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 - AuthorPosts
- You must be logged in to reply to this topic.