How to automatically convert .txt file to .csv file format?

fulham

New Member
Joined
Aug 24, 2006
Messages
7
Hi,

I have a lot of .txt files that needed to be converted to .csv file format. Right now I am doing it manually using MS Excel i.e. File > Open. For each file, I need to specify the length of each fields one by one, so it is quite an effort for me.

Is there any way to automate this process using MS Excel or any other existing programs?

Thanks for your help!
 
That I do not know. If you find something please share it w/ me, I would be interested.

But for what it is worth, when I started working w/ excel, I thought I had a lot of data, but as it turns out my number is rather small compared to some of the heavy hitters here. I deal w/ about 20,000 line items.

So if you dont find something, dont dispair, it wont take you that long once you start on it.

good luck and post back when you need more help.
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi Doug!

I just learn from someone that my SAP BW can actually receive .txt data in addition to .csv. So, I dont need to convert .txt to .csv file anymore. Hurray! :LOL:

However, that still does not answer my original question, does not it.... :oops:
 
Upvote 0
If its a scheduled extract from SAP I presume each data field would be fixed length.

If that's the case can't you just use the macro recorder to record the opening of 1 file then run it for each file?
 
Upvote 0
fulham

If you want to process a number of files then the best way to go about it would be to turn on the macro recorder (Tools>Macro...Record new macro...) and to it manually for one or two of the files.

This should generate code that can then be adapted to work with all the files.

How the code will be adapted depends on how the files are stored/named.
 
Upvote 0

Forum statistics

Threads
1,221,487
Messages
6,160,116
Members
451,619
Latest member
KunalGandhi

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