plotting data from a txt file with excel - excel

I have a text file that I will upload it. I wanna to select just 2 columns and then plot it with something like excel!
the problem is that when i want to select a column, those things that selected, is not just one column. I try it to open with excel. however it opened but there was same problem again. I'm just wanna select all data of one column and then plot it.
I can not even copy or a paste a certain data. all data will copy instead.
My English is not adequate, I know. Hope to could convey my mean.
Any help will be appreciated.
file

In excel, select the first column which should contain all the columns from your text file.
In the excel menus (or using the search field), select « convert ». Then chose the type « delimiter », and select the delimiter in your excel file. Either a comma, or a tabulation, etc.
Click ok and this should do the trick

Related

AnyLogic: False number format when exporting data to excel

I collect various data in time plots. If I copy the timeplot data and then paste it into Excel, the number format is often wrong. For example, I often get a date like Aug 94 instead of the actual number from the TimePlot. Unfortunately, I can't easily format this date into a number either, since the formatted number does not match the actual number from the timeplot. If I format the date in the same format as the number above and below, then I get the number 34547. However, this number does not correspond to the actual number of the TimePlot. Anyone know how I can prevent this problem?
You can only solve this on the Excel side, AnyLogic provides the raw data for you. Excel then interprets stuff. You can test it by pasting the chart raw data into a txt or csv file.
So either fix your Excel settings or paste into a csv, then into an xlsx.
Or better still: Do not manually paste at all. Instead, write your model results into the AnyLogic database and export to Excel from there: this takes away a lot of the pain for you. Check the example models to learn how to do that.
This is not AnyLogic question, rather an Excel & computer formatting problem. One way of resolving this is changing computer's date and time settings.
Another way is to save your output at txt file in AnyLogic. Replace all . with ,. Then open empty Excel, select Text format for the columns. Copy-paste from the txt file.
In Excel there are a few options
when you paste use paste as text only option
But this does not always work as Excel will still try to format the stuff for you
Use the Paste Special option and then choose text
Also possible this will not work, based on your Excel settings.
Paste using the text import wizard
(This works for me without fail)
On step 2 choose tab delimited
On step 3 choose Column format as text for every column (you need to select them in the little diagram below)
You will then see the data exactly as it came from AnyLogic. See the example below where I purposefully imported some text which has something that Excel will think is a date. You will now be able to see what in your data made Excel thing your data needed to be formatted the way it is and then you can fix it. (post a new question if you struggle with this conversion)
But as noted by other answers first prize is to write all the important data to external files. But I know that even I sometimes want to export data from a chart and review it in Excel. Option 3 works for me everytime

Export Excel data with a custom deliminator in .csv

I want to export a huge excel file as a .csv, but the data contains commas within the cells.
How do I export the excel data to a .csv with the deliminator as this |
I've tried doing the usual "save as", but it is not working for my data.
Hi Check out this method in the below link, its what I have used in the past
https://www.howtogeek.com/howto/21456/export-or-save-excel-files-with-pipe-or-other-delimiters-instead-of-commas/
Summary:
Control Panel –> Region and Language, and then click the Additional settings
When in the additional settings find “List separator”
Change this to anything you want, in your case you would want the | pipe
By definition CSV stands for Comma Delimited.
Easy alternatives that were under your nose in the Save As window are:
"Formatted Text(Space Delimited)" though this won't be appropriate if you have spaces in your cells
"Text(Tab Delimited)" it is less likely you'll have tabs in your cells and people won't type those in to excel.
If you really want the 'pipe' | then I would suggest saving as tab delimited and running some kind of find & replace on the resulting text file. This is a bit of a workaround
A even bigger workaround is to concatenate the cells using a formula on the sheet with a | involved and the save as text only that column.

Excel pasting data issue

Hi all i have been conducting research using JNNS creating neural networks.
I have collected my results inside a result file and wish to create graphs with them to clearly present my findings in a report.
My issue is when pasting the result file contents (expected outputs and then actual outputs) into excel the whole set of results goes into the A1 column instead of spreading across multiple rows
Does anyone know how i would go about fixing this issue?
Example to aid question:
1.1 Expected result / actual result
0, 0, 1, 0
0.02501, 0.00013, 0.99952, 0
and pasting this into excel does this:
https://gyazo.com/38c089ebcfaca7b85d31caacd3e950f9
instead of this:
https://gyazo.com/22f1527df18e811871e53402cea4ab2f
Thanks
I am guessing your data is in a CSV format, do you have notepad++?
if you do open it there and click on the show all characters, i wanna know what do you have at the end of your lines CR or LF...
Thanks to OmarQA for the help, i needed to paste my data into a text file, replace all spaces with commas using the replace tool, then import data from text on excel and use comma as data separation and it solved the issue!
Thanks
It might be that excel's not recognizing the proper delimiter when you're pasting you data. On Excel, select the cell with the entire text (in your picture, cell A1) and go to the Data tab. Look for a button called "Convert text to columns" or something like that. It will open a new window asking you for parameters (delimiters, if comma is a decimal separator, etc) and it gives you a preview of how your data is going to look like with that setting. Just mess around a little bit and you should get your data good to go. Looking at your picture, it might be possible that you didn't select "tab" as a delimiter.

HH:MM:SS:MS Formatting in excel

I have a lot of data in the form of
"00:00:03:19"
(hh:mm:ss:milliseconds)
I can not do much with it since excel is interpreting the data as text. Under "format cells/custom"
I can not find an appropriate entry for the data.... How can I teach/show excel what kind of data I am processing there?
I'm afraid the only option for Excel to read that properly is to somehow replace the last colon : with a decimal point. It's not until Excel understood your data as expected that you can think of the appropriate display format.
How are you receiving this data? If you can have all these values aligned in a single column in a csv file for example, by using a good text editor like Notepad++ you could select all the last : with ALT + mouse, replace them all at once, and finally load that into Excel.
One option is:
=SUBSTITUTE(A1,":",".",3)
select, Copy, Paste Special, Values then Text to Columns with Tab as the delimiter.
I found another solution!
I pasted the timevalues into the A column and split it via the LEFT,MID RIGHT comands
(eg:00:00:01:21 in A3)
A---------------------B-----------------C----------------D---------------E-----------------------F--------
00:00:01:21 -- LEFT(A3;2) -- MID(A3;4;2) -- MID(A3;7;2) -- (RIGHT(A3;2)) -- E3+(D3*1000)+(C3*60000)+(B3*3600000)

Looking up multiple values in a list

I'm trying to select multiple values based on a search key. In it's most basic form there is no problem with this. I followed this example and everything went well:
http://office.microsoft.com/en-us/excel-help/how-to-look-up-a-value-in-a-list-and-return-multiple-corresponding-values-HA001226038.aspx
=IF(ISERROR(INDEX($A$1:$B$7,SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1)),2)),"",INDEX($A$1:$B$7,SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1)),2))
The problem with this however is that in my case I have multiple CSV files (external) where some values in my A$ column look like this:
=- sometext // results into #NAME? error
Excel interprets these as a formulas where it is actually only supposed to be a string. Sure I could change it to text and save it again but I would like to avoid any manipulation in these CSV files.
I tried to extend the second IF statement (if you read it from left to right) with:
IF(AND($A$1:$A$7 <> "#NAME?", $A$1:$A$7=$A$10,ROW($A$1:$A$7)))
and
IF(AND(NOT(ISERROR($A$1:$A$7)), $A$1:$A$7=$A$10,ROW($A$1:$A$7)))
Both didn't work. (Sorry if I messed up some syntax and formula names, I'm using a different language version)
Here a small image of what's happening right now and how it should look:
On the right site you can see a list of values right next to Test1 which are missing on the left site due to the #NAME? error.
I would suggest opening the csv's files as text files. Selecting Comma as your delimiter and then select Text as your Column data format. This way, Excel will treat all your data as text and will not try to read =- sometext as a formula.
To do so, you would need to change your .csv files extension to .txt or anything else (even no file format).
Instead of "Opening" the CSV file, you can "Import" it. This will open the Text Import Wizard which will allow you to specify particular columns as Text. This is located in different areas in different versions of Excel. In Excel 2007, it is on the Data Tab / Get External Data / From Text. The example below demonstrates bringing in long numbers, but it should work just as well with your formula "lookalikes"

Resources