Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Unanswered: splitting up a csv file

    Hello All.

    i am a little stuck , my understanding of excel access and others is a little limited ..

    I have a csv file and access to more.
    these files contain products/descriptions/urls/prices etc

    if i have a file that contains 10 products with 9 fields in each
    i want to load into excell and have 10 rows of 9 columns

    but i only get 1 row with 90 columns ?

    i use the correct delimiter of | that seperates the fields but it seems theres no carrage return on the end of every 9th field to indicate the next row

    I have attached an example so hope someone can direct me in the right direction.

    Kind Regards
    Carl

    maybe a step by step help would be best for me
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2004
    Location
    Beaverton, Oregon, USA
    Posts
    11

    Re: splitting up a csv file

    It looks like there's no programmatical way to determine the end of a record--except for a certain number of fields. From my testing, Excel will consider fixed-length fields, but not fixed-number-of-field records.

    I'm guessing you'll need to write a script that knows about the number of fields and puts in the CR/LF every 9th field. I don't know VBScript well enough to do it, but am sure it can be done. Otherwise, take whatever your favorite programming tool is and do it externally, to modify the file before importing it.
    David Cornelius
    http://CorneliusConcepts.com

  3. #3
    Join Date
    Feb 2004
    Posts
    2

    Thanks for input :) all sorted :)

    Thanks.

    I tried Vb and i had it working just fine other than the fact i could only load a file variable large enough to hold about 100 records ..

    I found another way

    I loaded the text file into WORD
    set to the start of the document and set a macro to :

    find the next | and repeat 9 times
    add a CR
    then do again until the end of file is reached
    save as a text file

    when loaded into excel BINGO !!! all sorted

    Kind Regards
    Carl@4thstar.net

    Hope this helps others with the same pain in the Ar$ problem

Posting Permissions

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