• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to create a fixed width file

I have never created a fixed width file before. How can I do this in Excel? The attached file shows the numbers of characters each column would contain.

Do I create data validation based on the number of characters? Or do I just enter values up to the character limit and if any value is less than the character limit do I precede that with space characters?

I'm going to upload the fixed width file into a database.
 

Attachments

  • Fixed Width File.xlsx
    8.3 KB · Views: 11
GraH - Guido
Only the OP would know or won't ... using interesting terms.
I have never created a fixed width file before. How can I do this in Excel?
I'm going to upload the fixed width file into a database.
... the numbers of characters each column would contain ...

with which font and size ... all matters as You know.
What would be a fixed something?
 
FWIW, fonts and size won't matter if it is DB. But character set and field length will matter for sure. I suppose GraH-Guido has a point.

@DashboardNovice what if cell has more characters than you are specifying in column limit?
 
Sorry for being a bit late to the discussion. I have attached a modified version of the file with some explanation. Also included is a text file of the output. It extends beyond your desired width as noted in the workbook.

I'm not entire sure if this is what you were after, but it is something I have found useful for creating certain fixed format input files.

I hope it helps.

Regards,
Ken
 

Attachments

  • Fixed Width File_KenU.xlsx
    11.6 KB · Views: 7
  • FixedWidth.txt
    68 bytes · Views: 7
Back
Top