How to convert excel file to plain text

hj630

New Member
Joined
Aug 14, 2015
Messages
22
Hi all, I have a very difficult situation and hope you can help. I need to save excel into text. Here are the things I have tried
1. Save is space delaminated file: Problem is it is limited to 250 character per line so lots of the data is lost
2. Save as tab delaminated file: it will generate double quote for special characters.

THe file has many more than 100k lines so writing a code to write each cell into text is extremely slow. ALso, I need to save hundreds of this type of files, so I cant manually copy the excel data directly into txt (which works exactly like what I want, but I dont know if there is a way to write VBA code to control notepad to let it save the file).
My data is like this:

[TABLE="width: 2003"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Building[/TD]
[TD],[/TD]
[/TR]
[TR]
[TD] Nashville International Ap TN 1640 sqft[/TD]
[TD], !- Name[/TD]
[/TR]
[TR]
[TD="align: right"]180[/TD]
[TD], !- North Axis {deg}[/TD]
[/TR]
[TR]
[TD] Suburbs[/TD]
[TD], !- Terrain[/TD]
[/TR]
[TR]
[TD="align: right"]0.05[/TD]
[TD], !- Loads Convergence Tolerance Value[/TD]
[/TR]
[TR]
[TD="align: right"]0.05[/TD]
[TD], !- Temperature Convergence Tolerance Value {deltaC}[/TD]
[/TR]
[TR]
[TD] FullExterior[/TD]
[TD], !- Solar Distribution (FullExterior = Shading from/on exterior surfaces. All interior direct solar falls on the floor and is absorbed according to the floor's absorptivity. The reflected beam solar from the floor is added to the transmitted diffuse radiation[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
The only option is going to write each cell to the text file one cell at a time. I ran a macro that wrote 3.4 million cells to a text file (114591 Rows x 30 Columns writing one cell at a time) and it took about 30 seconds which if you have "hundreds" of files it would only take up to 9 hours. I also tested with manually copy/paste from excel to notepad and it actually took about 40 seconds, so I'm kind of doubting you'll find a way to write all of your data to text files any faster without using a language other than VBA.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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