I have this data that I exports from some ERP in Citrix to the same Excel in Citrix,
Some example when i paste:
Doc.Curr.
-4,248,057.00
-25,998,733.00
25,998,733.00
-192,534.00
-118,509.00
192,534.00
But when i export this to a Excel in MacOS doesnt recognize like a number format, only like data without format, how can i solve this?
Many systems that export to Excel produce text instead of number. This has to do with the way that the system report was built in the exporting system. For example, the system report uses spaces to separate report columns. Excel parses the data according to the spacing but will not convert the text to numbers. In such a case you need to do that yourself
There are several ways to convert text to numbers, including
copy a cell with a zero, use paste special to paste over the text that should be numbers, using the option to "Add"
use text to columns on one column of numbers
If you need to do that on a regular basis, you may want to look into Power Query (Get and Transform) to load the data and perform any cleanup in there. It will be faster in the long run.
Related
I am using Excel to compare error messages. My error message looks like this .
You have changed the values.
Do you want to continue?
I entered this value in excel using Alt+Enter, when reading this value from UFT, this carriage return is not considered.
How to include carriage return in excel so that it is visible when reading the values from UFT?
First, try to create a string formula, i.e. instead of entering the line break in the string, create a formular like
="<value>"
where <value> is the string value that you originally wanted in your cell, with the line feed contained within the quotation marks.
This might solve your issue.
But:
This is just the top of the mountain of known issues with UFTs data table API. Here is an incomplete list of additional issues (some of which, but not all, are fixed or at least improved upon in 15+):
Date values are not properly handled, especially if you are using a
non-US locale and try to consume values auto-formatted by Excel as
dates
Strange things happen if you have an .xls file. Use an .xlsx file instead. (This used to be the other way around). Note it is not only the extension I am referring to, but also the format (Excel-95 vs. more modern format)
Many formulas are unsupported Formatting behavior differentfrom what Excel would do/show
CRs and LFs are handled differently
from what Excel does
Built-in table editor is quite a silo of bugs
and antiergonomic cell values are limited in length; at the same
time, formulas have different length limits. I.e. a string in a cell is
limited to a certain maximum number of characters, but a formular
returning a string does not have that (but maybe a higher) length
limit
Because of this (and more), we auto-convert all excel sheets on the fly before when we use them in UFT after they have been updated. To do this, we are using Excel Interop (i.e. Excel´s COM automation interface) to spawn an Excel instance, create a converted version that has all formulas and formatting resolved to just string formulars, and use the converted sheets with UFTs DataTable.ImportSheet feature. Which means we unfortunately need Excel on all execution machines.
So my recommendation would be to stay away from the data table editor in UFT. Use Excel, and make sure all your edits come through to UFT in a meaningful way. If they don´t, consider a converter that creates a DataTable-compatible copy of your sheet.
Yes, I know this is suboptimal, but that´s what it has come down to after years and years of struggling with the DataTable API and UFTs "superb" built-in data table editor.
I noticed that anytime I export from somewhere like Salesforce where the Phone = +123124141.
The data in Excel will just become =123124141 or #NAME? or some other Error spouted from Excel.
This makes data patch extremely painful and manual. Any ideas how to get around this?
When you create the file, use a different extension than .csv or .txt (these ones are interpreted by EXCEL as a green light to interpret columns as numeric/date, etc and format accordingly. Use .DAT, for example. When you open it from within EXCEL it will invoke the text import wizard, and there you should choose comma separated (or tab separated, etc, as the case maybe), and on the final screen of the wizard, choose the columns you don't want reformatted (you can choose all of them, if you like), and choose Text. Now the column values will be kept intact.
Alternatively you can first create a blank workbook/sheet, and use Data From Text to invoke the Wizard and bring the data in the same way.
If you don't want EXCEL to launch and open when you double-click on a .CSV file, without asking questions, you can remove the file-association (of CSV with EXCEL) using Windows explorer.
It is reasonably easy to develop a VBA macro to import such delimited files using 'TEXT' data types to automate what the Wizard would do.
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
I am trying to write a VB script in Excel to parse some data in an Excel cell. To parse the data correctly, I need to utilize the formatting in the cell. For example, the text to be parsed below should be parsed as follows: a. MINESHAFT B. DARNLEY BAY. The only way to tell this is because MINESHAFT is displayed in a smaller font.
Is there anyway I could right a VB script that could parse the cell text based upon the hidden formatting codes in the cell.
Text to be parsed: MINESHAFT DARNLEY BAY
I'm currently trying to accomplish this in Mac 2011 Office Excel, but I could also do in on a PC Excel 2010 if it makes a difference.
Thanks for you help.
I'm sure you probably can find out the font of a section, but I think you should analyse your data to try and find another way of pulling out the information you want.
Why is the first word a different font?
Are there a finite number of MINESHAFT words?
Could you find the MINESHAFT, ETC word at the begining and put that in a, and then put the rest of the string into b?
If you post a greater amount of data you are trying to parse we might be able to help.
I run a process to produce a rather large CSV file of data. Sometimes I find it helpful to open the CSV in excel, make changes manually, and then re-save. However, if there are dates in the CSV, excel automatically reformats them. Is there a way to prevent excel from doing this? It would be helpful if I could turn off all text formatting altogether.
If you prepend an apostrophe ' to the beginning of any date string during the export process, Excel will read the value literally (i.e. as plain text) rather than trying to convert it to a date.
This particular solution is handled during the export process. I'm not sure how you would change Excel to treat the file differently at runtime.
Excel does some nasty tricks when outputting XML. One of its tricks is to drop left most column delimiters if 16 or so consecutive rows have no values for these columns. This means that if you're splitting the lines up based on commmas then these rows will have a different number of columns to the rest.
It will also drop any initial 0's so things like numeric Ids can become messed up.
Another risk you run is chopping the file off short since Excel can only support a maximum number of rows. (Prior to Excel 2007 this was around 65536)
If you need to do anything to a CSV file other than read it use a text editor.
When you import the CSV file into Excel, be sure to pre-format the date column as text. There's a frequently overlooked option in the parsing that allows you to control the format column by column. This also works well for preventing the leading zeros in New England ZIP codes from getting dropped in your contact lists.
If you used the excel file version which is 2010 or later (not sure lower version), you can set up to use current operation-system date format or not in Excel/CSV file.
Right Click cell with date value (e.g. '9/12/2013') in CSV file and pop up the menu
Click 'Format Cells' and open a pop up screen
Go to 'Number' tab and you can see 'Date' was selected in 'Category' (left side) and 'Type' on the right side
Observed that there are two types of Date format (one is with () and another is not with ()). Read the comment there and you can find that you can use the date format which is not with date. It means that your changes to the CSV file will not be applied with your current operation-system date format. So, I think date format won't be changed in CSV file in this case.