+ Reply to Thread
Results 1 to 3 of 3

Export file to CSV delimited with fixed field length

  1. #1
    Plucky Duck
    Guest

    Export file to CSV delimited with fixed field length

    Hi there!

    I have an Excel file with a series of fields, each in one column.

    What I need to do is determine a fixed length for each of these fields, so
    that when I export this file to a CSV file, I get a file in which each column
    has exactly the same fixed length.

    For example, if my Excel file contains:

    A B C
    1234 ABC21 1234

    and I want fields to have these fixed lengths:
    A - 5
    B - 6
    C - 4

    my CSV file should contain:
    1234 ;ABC21 ;1234

    Any easy way of accomplishing this? I tried custom cells but when exporting,
    I lose the information.

    Thanks in advance.

  2. #2
    JE McGimpsey
    Guest

    Re: Export file to CSV delimited with fixed field length

    One way:

    http://www.mcgimpsey.com/excel/textf...tml#fixedfield


    In article <[email protected]>,
    "Plucky Duck" <Plucky [email protected]> wrote:

    > Hi there!
    >
    > I have an Excel file with a series of fields, each in one column.
    >
    > What I need to do is determine a fixed length for each of these fields, so
    > that when I export this file to a CSV file, I get a file in which each column
    > has exactly the same fixed length.
    >
    > For example, if my Excel file contains:
    >
    > A B C
    > 1234 ABC21 1234
    >
    > and I want fields to have these fixed lengths:
    > A - 5
    > B - 6
    > C - 4
    >
    > my CSV file should contain:
    > 1234 ;ABC21 ;1234
    >
    > Any easy way of accomplishing this? I tried custom cells but when exporting,
    > I lose the information.
    >
    > Thanks in advance.


  3. #3
    Earl Kiosterud
    Guest

    Re: Export file to CSV delimited with fixed field length

    Plucky,

    Generally, you use fixed fields without the commas (fixed-length), or
    variable-length fields with the commas (delimited). You're wanting to do
    both. Are you sure? Why? Before you go to a lot of trouble, you should
    probably manually make a small test file with NotePad, and see how the
    program that will eventually read the file does with it.

    There's a way, using the prn format in Excel's Save as, to do the
    fixed-length. I think folks have had pretty good luck with it.

    Both these issues are discussed at www.smokeylake.com/excel.
    --
    Earl Kiosterud
    mvpearl omitthisword at verizon period net
    -------------------------------------------

    "Plucky Duck" <Plucky [email protected]> wrote in message
    news:[email protected]...
    > Hi there!
    >
    > I have an Excel file with a series of fields, each in one column.
    >
    > What I need to do is determine a fixed length for each of these fields, so
    > that when I export this file to a CSV file, I get a file in which each
    > column
    > has exactly the same fixed length.
    >
    > For example, if my Excel file contains:
    >
    > A B C
    > 1234 ABC21 1234
    >
    > and I want fields to have these fixed lengths:
    > A - 5
    > B - 6
    > C - 4
    >
    > my CSV file should contain:
    > 1234 ;ABC21 ;1234
    >
    > Any easy way of accomplishing this? I tried custom cells but when
    > exporting,
    > I lose the information.
    >
    > Thanks in advance.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1