0

I am copying several hundred rows of comma delimited data into Excel 2010 (32-Bit version).

Part of the data in some rows get separated into columns, e.g. (just an example - does not actually happen):

{1, "Hello", 8,"Bye"},
{2, "John", 9,"Joe"},
{3, "Hot", 10,"Cold"},
{4, "Bad", 11,"Good"},
{5, "Red", 12,"Blue"},

Gets copied as:

Column A                          Column B             
{1, "Hello", 8,"Bye"},
{2,                              "John", 9,"Joe"},
{3, "Hot", 10,"Cold"},
{4, "Bad",                       11,"Good"},
{5, "Red", 12,"Blue"},

The maximum row length I am copying is 235 and Excel should allow at least 255 characters. I have read that Excel 2010 allows 32,767 characters per cell.

Does anyone know why some of the rows are getting separated in separate columns?

Here is an example of a row that Excel put into separate columns:

/* XXX */{"00000000000000000", XXXXXXXXXXXXXXXXX       , XX(XXXXXXXXXXXXXXXXX      ), XXXX , "X"   , XXXX       , X    , XXXXXX     , X          ,  XX, XXX, XXX, XXX    , XXXXXXXX, XXXXXXXX , XXXXXXXXXXX     , XXXXXXXXXXX   , "XXX" },

Here is an example of a row that Excel did not put into separate columns:

/* XXX */{"XXXXX X. XXXXXX*"  , XX.XXXXXXXXX            , XX(XXXXXXXXXXX            ), XXXX , ""     , XXX  , XX   , X     , X         ,  XX, XXX, XXX, XXX    , XXXXXXXX, XXXXXXXX, XXXXXXXXXXXXXX, XXXXXXXXXXXX  , ""             },
7
  • I think you are going to need to give the actual example where you replace any private data with something else.
    – Carter
    Sep 24, 2014 at 16:08
  • Here's the Example:/* XXX */{"00000000000000000", XXXXXXXXXXXXXXXXX , XX(XXXXXXXXXXXXXXXXX ), XXXX , "X" , XXXX , X , XXXXXX , X , XX, XXX, XXX, XXX , XXXXXXXX, XXXXXXXX , XXXXXXXXXXX , XXXXXXXXXXX , "XXX" }, Sep 24, 2014 at 17:02
  • Here's an Example that doesn't get separated: /* XXX /{"XXXXX X. XXXXXX" , XX.XXXXXXXXX , XX(XXXXXXXXXXX ), XXXX , "" , XXX , XX , X , X , XX, XXX, XXX, XXX , XXXXXXXX, XXXXXXXX, XXXXXXXXXXXXXX, XXXXXXXXXXXX , "" }, Sep 24, 2014 at 17:49
  • that pastes as the same text to me.
    – Carter
    Sep 24, 2014 at 18:33
  • Try adding it up above as code rather than in these commnets.
    – Carter
    Sep 24, 2014 at 18:33

2 Answers 2

1

I would use something like Notepad++ and its find and replace feature. Replace the brackets with nothing and replace the commas with \t (using "Extended" Search Mode. Then copy and paste

3
  • Ok...I didn't explain whether I wanted the data to get separated or not:). It might sound strange, but I don't want the data to get separate into separate columns. Sep 24, 2014 at 16:10
  • gotcha, I guess it depends on where you are copying the data from i.e. HTML, Word, Text, etc. There could be extra spaces or characters being added.
    – xjx424
    Sep 24, 2014 at 16:24
  • Notepad++ and Notepad give me the same results. Sep 24, 2014 at 16:57
1

There seems to be something like a tab character is some of your data. Your options are either:

  • deal with this before input to Excel, or
  • deal with this in Excel.

For the former something like Notepad++ (or many other applications) should suit, as indicated by @xjx424 (to replace the control sequence having determined what that is).

For the latter (my preference), if {1 etc is in A2, I'd put:

=TRIM(A2&B2)  

in C2 and copy down to suit. Then select all, Copy, Paste Special, Values over the top and delete ColumnsA:B.

If getting split (sometimes) into more than two pieces this is easy to extend.

1
  • 1
    Fantastic. Thanks. I didn't realize a tab would cause Excel to separate the text into different columns. Sep 24, 2014 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.