Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import a text log file into a excel columns

Tags:

text

excel

I have some data of form

[39645961,-79966658]358920045121212[0.75]2013-01-30 20:47:52
[39646124,-79966771]358920045121212[0.5]2013-01-30 20:47:54
[39646134,-79966733]358920045121212[0.5]2013-01-30 20:47:56
[39646123,-79966723]358920045121212[0.5]2013-01-30 20:47:58
[39646144,-79966724]358920045121212[0.5]2013-01-30 20:48:09
......

How can I import them into an excel file into separate columns. like

39645961 -79966658 358920045121212 0.75 2013-01-30 20:47:52
39646124 -79966771 358920045121212 0.5 2013-01-30 20:47:54
39646134 -79966733 358920045121212 0.5 2013-01-30 20:47:5

Any ideas?

like image 807
ChanChow Avatar asked Sep 01 '25 04:09

ChanChow


2 Answers

If it's not too frequent task:

  1. Copy-paste the text to Excel (will occupy one column)
  2. Data - Text to Columns (Excel 2003)
  3. Delimiters: Comma and Other: ]
  4. After completing the operations, insert a column after the remaining non-splitted fragment (358920045121212[0.75) and repeat Text to Columns for this column only with Other delimiter as [.
like image 125
Jüri Ruut Avatar answered Sep 02 '25 19:09

Jüri Ruut


1) Copy the data into a text file, like Notepad.

2) Use find and replace to replace bracket characters with a tab character. You can not directly type a tab character into the replace field, because it will just move your cursor to the next field. To get around this: Open another Notepad window and press tab, then copy the tab into the replace field of the original Notepad window. Hit replace and repeat this process with space and comma characters.

3) Save and close the notepad file.

4) Open the notepad file in Excel. (choose file, open, and don't forget to change the file type in the open dialog from "All Excel Files" to "All Files"

5) This will open the Text Import Wizard. Hit next, next and finished, and the data should show up in separate columns

like image 23
zcotter Avatar answered Sep 02 '25 17:09

zcotter