Advanced excel: column breaks every n characters (text to columns, fixed width)

mrNeedHelpNow

New Member
Joined
Jul 20, 2018
Messages
1
Hello dear MrExcel community,

I have stumbled upon a problem that for me is really hard to resolve.
Problem is that I have a file in .txt format, after I open it with excel I need to get columns with it with Text To Columns option.

The thing is, fixed width needs to be selected and then you have to manually insert column breaks on certain characters.

The length is over 1600 characters, so manually doing this wont help.

I would need a script or something similar.

I have a mapping according to where this needs to be done:

For example:

1st column =
[TABLE="width: 280"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Position from char[/TD]
[TD]Position to char[/TD]
[TD]field length char[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]8[/TD]
[TD]8
[/TD]
[/TR]
</tbody>[/TABLE]


and so on.

can this be done with a script ?

Thanks,

Your friend who needs help
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Best option is to record a macro doing the first few columns, you can then expand that for all the columns.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top