+ Reply to Thread
Results 1 to 5 of 5

Importing CSV file into single column/multiple rows vs. multiple rows/single column

  1. #1

    Importing CSV file into single column/multiple rows vs. multiple rows/single column

    Hello, I need to know how to import data into a single column with
    multiple rows. By default, when importing a CSV or TAB txt file, it
    imorts data across multiple columns in one row but I need it to go into
    one column and multiple rows. I don't have the option on the import
    wizard.

    Thanks,
    Brian


  2. #2
    Bernie Deitrick
    Guest

    Re: Importing CSV file into single column/multiple rows vs. multiple rows/single column

    Brian,

    Open it as usual, then do a copy pastespecial transpose.

    HTH,
    Bernie
    MS Excel MVP


    <[email protected]> wrote in message
    news:[email protected]...
    > Hello, I need to know how to import data into a single column with
    > multiple rows. By default, when importing a CSV or TAB txt file, it
    > imorts data across multiple columns in one row but I need it to go into
    > one column and multiple rows. I don't have the option on the import
    > wizard.
    >
    > Thanks,
    > Brian
    >




  3. #3
    Wm Seales
    Guest

    Re: Importing CSV file into single column/multiple rows vs. multiple rows/single column


    [email protected] wrote:
    > Hello, I need to know how to import data into a single column with
    > multiple rows. By default, when importing a CSV or TAB txt file, it
    > imorts data across multiple columns in one row but I need it to go into
    > one column and multiple rows. I don't have the option on the import
    > wizard.
    >
    > Thanks,
    > Brian




    An example of a CSV going into one column,
    multiple rows (but note complete lack of
    error handling):




    Sub Example()

    Dim i
    Dim sTemp As String

    i = FreeFile

    Open "C:\MyFile.txt" For Input As #i
    n = 0
    Do While Not EOF(i)
    Input #i, sTemp
    ActiveCell.Offset(n, 0) = sTemp
    n = n + 1
    Loop
    Close #i

    End Sub


  4. #4

    Re: Importing CSV file into single column/multiple rows vs. multiple rows/single column

    Script works great. Thanks for your help!


  5. #5
    Registered User
    Join Date
    07-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Importing CSV file into single column/multiple rows vs. multiple rows/single column

    If your data has commas between each item, use an editor to 'find and replace' the commas into newlines.
    If each data item is on it's own line, Excel will automatically import the text into a single column.

+ 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