-->

Convert Text to Table (Space Delimited or Fixed le

2020-08-03 06:03发布

问题:

I have a text file with tab delimited data (150 lines) that i want to convert to space delimited or fixed length columns. I have tried to export the file using Excel's .prn format but when opened in MS Notepad it loses all formatting.

Let us consider the file as:

Product Name    Product Key
Autodesk 3ds Max 2019   128K1
Autodesk 3ds Max 2019 with Softimage    978K1
Autodesk Advance Steel 2019 959K1
Autodesk Alias AutoStudio 2019  966K1
Autodesk Alias Concept 2019 A63K1
Autodesk Alias Design 2019  712K1
Autodesk Alias SpeedForm 2019   A62K1
Autodesk Alias Surface 2019 736K1
Autodesk AutoCAD 2019   001K1

Now what is want is this:

       Product Name                  Product Key
Autodesk 3ds Max 2019                   128K1
Autodesk 3ds Max 2019 with Softimage    978K1
Autodesk Advance Steel 2019             959K1
Autodesk Alias AutoStudio 2019          966K1
Autodesk Alias Concept 2019             A63K1
Autodesk Alias Design 2019              712K1
Autodesk Alias SpeedForm 2019           A62K1
Autodesk Alias Surface 2019             736K1
Autodesk AutoCAD 2019                   001K1

I have used this tool and it does the job but again when saving in MS Notepad, the columns are misalinged and i want the data only in Notepad...

P.S. Is there anyway to do it using any tool that works in Notepad..EXCEL.CMD.SHELL. I love terminal.