+ Reply to Thread
Results 1 to 8 of 8

Split data into columns

  1. #1
    Registered User
    Join Date
    07-19-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Split data into columns

    Hello. I have a text file that contains book bibliographic information. The file contains informations that looks like this:

    =LDR 01215nam 2200289 a 4500
    =001 EDZ0000075364
    =003 StDuBDS
    =005 20120531150050.0
    =006 m||||||||d||||||||
    =007 cr||||||||||||
    =008 091203s2005\\\\enka\\\fo\\\\\001\0\eng\d
    =020 \\$a9780191603099 (ebook) :$cNo price
    =020 \\$a0191603090 (ebook) :$cNo price
    =040 \\$aStDuBDS$cStDuBDS
    =050 \4$aB105.M4
    =082 04$a121.6'8$222
    =100 1\$aDavis, Wayne A.,$d1951-
    =245 10$aNondescriptive meaning and reference$h[electronic resource] :$ban ideational semantics /$cWayne A. Davis.
    =260 \\$aOxford :$bClarendon,$c2005.
    =300 \\$a1 online resource (xiii, 450 p.) :$bill.
    =520 8\$aWayne Davis presents a highly original approach to the foundations of semantics, showing how the so-called 'expression' theory of meaning can handle names and other problematic cases of nondescriptive meaning.
    =588 \\$aDescription based on print version record.
    =504 \\$aIncludes bibliographical references and index.
    =650 \0$aMeaning (Philosophy)
    =650 \0$aReference (Philosophy)
    =776 08$iPrint version$z9780199261659
    =856 40$3Oxford scholarship online$uhttp://dx.doi.org/10.1093/0199261652.001.0001


    Each book contains the same fields but it is listed this way and separted by an empty row.

    I need each line to be in a column so "=LDR" is a column heading, "=001" is a column heading "=003" is a column heading and so on. Can this be done?

    I'm attaching a shrunken version of the text file so that you can see how book information is listed. The acutal text files has over 8000 books.

    I am also attaching of the desired result in a spreadsheet.

    Thanks!
    Sonia Duran

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Split data into columns

    1) Open the txt file in excel
    2) When prompted, by import wizard, click radio button "Fixed Width" and click next twice
    3) Still in import wizard , i.e. step 3 of wizard , indicated both columns are text and not general .. then click finish
    4) On the excel sheet select the information in Column A and ColumnB
    5) Select copy
    6) click C1 and select pasteSpecial ...
    7) In pasteSpecial window select the Checkbox (Transpose) and click ok
    Done !

    Suggestion: To get rid of "=" in text use Find/Replace to replace "=" with nothing
    Last edited by nimrod; 11-18-2014 at 03:19 PM.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Split data into columns

    You say you have a spreadsheet example that show what the desired result is. If you will upload that it will be much easier to see the desired results and answer some questions that the *.pdf can't....for example: there are multiple "=650" entries in some blocks. These are not unique fields.......?.....
    Last edited by FlameRetired; 11-18-2014 at 03:45 PM.

  4. #4
    Registered User
    Join Date
    07-19-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Split data into columns

    That's half of what I needed. Is it possible to have each entry dispay in a separate row?
    Please see attched document for farther explanation.

    Thanks again.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-19-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Split data into columns

    Ok, I'm attaching the spreadsheet with the first 3 entries on the text file.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Split data into columns

    I think an easier solution would be with VBA ... are you willing to look at that ?

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Split data into columns

    Quote Originally Posted by SonDur View Post
    That's half of what I needed. Is it possible to have each entry dispay in a separate row?
    Please see attched document for farther explanation.

    Thanks again.
    OK. Your column headings are not unique in their respective "LDR" blocks. There are duplicate "650"s with different data.

  8. #8
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Split data into columns

    Here is a macro that will read the TXT file and place the informations at the right places.
    If the same field exist more then once, the macro will concatenate them in the same cell.
    If fields are not present in your headings' row, it will create it at the end of the table.
    You'll have to change the file path in the code for your real file's location
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Split Data in Columns
    By naveenmarapaka in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-05-2013, 06:54 AM
  2. Split uneven data from a single columns to multiple columns
    By pfoz in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-13-2013, 08:24 AM
  3. Data split in 2-3 columns
    By mohan.r1980 in forum Excel General
    Replies: 6
    Last Post: 04-14-2012, 09:45 AM
  4. split 1 case data to 2 columns
    By neorez in forum Excel General
    Replies: 5
    Last Post: 02-11-2010, 05:58 AM
  5. Split data in one column into two columns
    By maacmaac in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-12-2009, 05:07 PM

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