How to import a text log file into a excel columns - 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?

If it's not too frequent task:
Copy-paste the text to Excel (will occupy one column)
Data - Text to Columns (Excel 2003)
Delimiters: Comma and Other: ]
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 [.

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

If you want to do it strictly in Excel, you will have to extract the individual data elements from each string using a combination of text functions, including SEARCH or FIND, LEFT, MID and RIGHT. The following formulas show one wqy to extract each element from one of the strings, which I have assumed is in A1.
=MID(A1,2,SEARCH(",",A1)-2)
=MID(A1,SEARCH(",",A1)+1,SEARCH("]",A1)-SEARCH(",",A1)-1)
=MID(A1,SEARCH("]",A1)+1,SEARCH("]",A1)+SEARCH("[",MID(A1,SEARCH("]",A1),99))-SEARCH("]",A1)-2)
=MID(A1,SEARCH("[",A1,2)+1,SEARCH("]",MID(A1,SEARCH("[",A1,2)+1,99))-1)
=MID(A1,SEARCH("????-??-??",A1),10)
=RIGHT(A1,8)
You would enter these formulas horizontally to the right of A1, then copy them down.

There is a much simpler way - use a third party piece of software.
The one I used costs me very little for the year, but means i don't need to mess around with trying to get it right.
Its the only tool i found which isn't a monthly subscription as well.
Its a desktop based application.
https://onpage.rocks/product/server-log-tool/

Related

Excel formatting time as regular numbers

I've pasted into an excel file lots of number such as 43:11 or 22:06. These represent goals scored and goals against. However excel is recognising them as dates and times. I want it so that I have two columns with 43 and then 11 for example, instead of 43:11. Whatever I have tried it has become confused because it things of it as a time. I've tried formatting as text, numbers etc. Any ideas?
This will work in Excel 2016 (other versions have the same functionality but the menus may be slightly different):
Copy your numbers to the clipboard
In Excel, select the Home ribbon
Click the downward arrow under the Paste button (the leftmost icon on the ribbon).
Select Use Text Import Wizard
Wizard appears. Make sure Delimited is checked and My data has headers is not checked.
Click Next.
In the Delimiters group, uncheck Space, check Other and in the box next to it type :
Click Finish
If you are typing values into a cell, then format the cell as Text before typing. If you are importing material from an external source, then tell the Import Wizard that the field containing these values is Text.

Save or Export Excel as csv with commas in cell values

My Excel has a block with a comma , eg. abcd,xyz.
When I convert this Excel to CSV, this text gets converted as 2 columns.
Can anyone advise how I can prevent this?
Excel by default will use a comma as the delimiter, but you can change that:
Go to Control Panel > "Region and Language" (Or just "Region" in Windows 10), and then click the "Additional settings" button on the bottom.
Now look very closely at the List separator item, which normally
has a comma in the field, and for the purposes of this illustration,
change it to a Pipe | character.
Once you hit Apply, and then save your Excel file as a CSV file, you’ll notice that your file now has pipe | characters as the delimiter.
PS: You'll probably want to change the List separator back to a comma just in case some other application needs it.

Loading Excel values to Teradata

The Excel file I am using has cells which contains multiple lines typed in by using Alt+Enter. When this Excel is load into teradata, these multiple lines in single cell should reflect in single cell in the teradata table also. But instead, it is getting loaded as several rows. How to rectify this?
Go to Find & Replace (aka Ctrl+H). Type Ctrl+J in the Find what: text box and put a space or some alternate character in the Replace with: text box. Make sure that the Match entire cell contents is not active and click Replace All.
This effectively changes all instances of line feeds (aka CHAR(10), vbLF or ASCII 0010) into spaces. If spaces will not suit your purposes, choose another character or text string.

Create Excel VBA to delete specific text from cell in one column

I am trying to create an Excel VBA that would delete only a specific part of the cell in only one column.
In Column A, I have a directory values:
For example:
Directoryof K:\data\Admin\
What I would like to do is remove the "Directoryof" from all the cells in column A and leave only the remaining text that follows it.
To create a macro to perform the above follow the below steps:
Click the "Developer" tab on the top menu.
You will find an option "Record Macro".
Click the Record Macro ->
a. A dialog box appears, give your macro a name
b. Shortcut key (if you want) can give by pressing (shift and any key such as
letters)
c. Store macro in : This workbook (this allows your macro to run on this sheet).
Click on "Use Relative References".
Once you are done, just perform the delete operation ( by removing the portion you do not want) on one of the column so that the macro may record the process which you are performing.
Once done, below at the lowest pane you will find Stop Macro option (a small blue square box). Click it to stop the recording of the macro.
Now you are ready with a macro to replicate the same without you performing the operation.
Just goto any other column where you want to perform the operation and click on "Macro" option on the developer tab and then click on your created marco, and you will see the magic happen.
You could probably use regex to accomplish what you are going for. Regular Expressions are often used for finding patterns. If all of your follows the same format, you could break your strings apart into two capture groups with something like:
(.+)([A-Z]:\\.+)
https://regex101.com/r/uD4uJ0/2 <-- this will show you your capture groups
Edit: I updated this link, sorry, originally had the wrong one.
This here How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops will show you how to split up capture groups if you are interested.
You could use something like text to columns, fixed width, and split the columns after Directoryof and then copy/paste the values back into column A.
I'm not sure if there's a method to do this without a helper column without VBA. If you can afford to use a second column, you can also use =LEFT(Cell, # of characters) assuming that the part you want to strip off is always "Directoryof" and then copy/paste values back into column A.

Is there a way to transfer MSWord numbering bullets to MSExcel column?

I have been using MSWord 2010 to compose list of questions. These questions are organized in single MSWord document, using numbering - 1. first question, etc...
I was wondering could contents of each bullet be transffered to MSExcel cell? So if i have 20 questions, i would have cell with 20 rows, each containing one question.
I am asking this because i have 300 questions that i want to import to excel.
It's possible to copy your numbered bullets from Excel to Word and then break them up using Excel worksheet functions. However, it's real easy to just do it with the built-in Excel commands.
In Word:
Increase the width on the hanging indent on your numbered list. It will make the conversion in Excel easier to deal with.
Select your bullets and copy them.
In Excel:
"Paste Special" the copied text into Excel using the Match Destination Formatting option.
Select the cells you pasted the bullets by the number of digits in the bullets (i.e., first do 1-9, then do 10-99, etc.)
With the cells selected, choose the Text to Columns command from the Data tab on the ribbon.
Make sure that the 'Fixed Width" radio box is selected on the dialogue box that comes up, then move to the next step.
Adjust the break lines so that there are three fields: one with the number + period, another the spaces between the numbers and text, the third the text.
Moving to the next step - select the second field (the spaces) and click the "Do not import column (skip) radio button.
Click finish and the bullets are imported.
The above answer is best if you have an already established list. The best workflow I've found for this is to create a table to work in, in word. That table then copies perfectly into cells in excel, allowing you to create a structure that will pass between the tow docs seamlessly.

Resources