Is it possible to transform:
John Apple Red 3 John Apple Green 5 John Radish White 2 John Radish Red 7 Tom Apple Red 3 Tom Apple Green 5 Tom Radish White 2 Tom Radish Red 7 to:
John Apple Red 3 Green 5 Radish White 2 Red 7 Tom Apple Red 3 Green 5 Radish White 2 Red 7 using Vim?
I have a large block of configurations (~10k). Each one is something like
Criterion1=1A Criterion2=2A Criterion3=3A... ConfigItem=valA Criterion1=1A Criterion2=2A Criterion3=3B... ConfigItem=valB Criterion1=1A Criterion2=2B Criterion3=3C... ConfigItem=valC Criterion1=1A Criterion2=2B Criterion3=3D... ConfigItem=valD Criterion1=1B Criterion2=2E Criterion3=3F... ConfigItem=valE I'm hoping to simplify the presentation to better understand it. Here's an example:
Criterion1=1A Criterion2=2A Criterion3=3A... ConfigItem=valA Criterion3=3B... ConfigItem=valB Criterion2=2B Criterion3=3C... ConfigItem=valC Criterion3=3D... ConfigItem=valD Criterion1=1B Criterion2=2E Criterion3=3F... ConfigItem=valE The format I've demonstrated above (replacing common repeated prefixes with spaces) would also help make folding work.
Criterion1=Value1 Criterion2=Value2 Criterion3=Value3 ... -> ConfigName=ConfigValue, now it's a long txt file, somewhat overwhelming, I'm looking to simplify it as the example above, what's more, the blank spaces would help in folding as i'm using vim.(.*)part matched the next line. currently I'm only using block editing to select some rows with common starting words, and thenrto replace that part with space.