How to change the type of waves (e.g., text wave --> number wave)

I pasted several columns of data (they are all numbers). And I found that some columns were recognized as text waves, instead of number waves, which they are supposed to be. To make a figure for text waves, I can only go to "Windows --> New Category Plot", rather than "Windows --> New Graph".

I am wondering how I can change or convert text waves to number waves (or the opposite way).

The other related problem is: When I enter dates into a column, the column sometimes is recognized as a text wave, but sometimes as a number wave. Why?


Thanks!
Here is an example of converting a text wave containing numbers to a numeric wave:
Make/T textWave = {"1.2", "2.3", "3.4"}
Make /D /N=3 numericWave = str2num(textWave)
Edit textWave, numericWave


If your text wave contains dates then it is a lot more complicated and depends on the format of the dates. Post an example of the text wave contents.

Quote:

The other related problem is: When I enter dates into a column, the column sometimes is recognized as a text wave, but sometimes as a number wave. Why?


To see the format that Igor expects dates to be in and to change it, choose Table->Table Date Format.

If the text you are pasting does not match the table date format then the table will create a text wave. It also will create a text wave if there are unexpected characters in the pasted text, for example, extraneous spaces or tabs.

If this does not solve the problem then tell me exactly what text you are pasting that creates a text wave.
You may already know this, and you may not be copying from Excel, but in case you don't:
When you copy and paste from excel you copy what is displayed in the cells. Unless you are displaying the entire number to 15dp you may be truncating the precision of the number.
I always change the formatting of the cell to number, and displaying 15dp. This may also be why some cells are copying as text and some as numbers (the cell may be formatted as text).

Problems solved. Thank you all!!!

One more question about the labeling on y-axis. Attached is an example, in which the y-axis is date and formatted as MM/DD/YY. How can I change that to the following format:

1). MM/YY (e.g., 1/2010, 7/2010, 1/2011, 7/2011, etc.)
or
2). Jan. 2010, Jul. 2010, Jan. 2010, etc.

I tried some changes in the "Auto/Man Ticks", but I was not allowed to change the date format in "Canonic tick, which shows "01/'01/1904".

Thanks!
Double-click the axis, click the Ticks&Grids tab, click the Data Format popup menu and choose Other.

For details execute this:
DisplayHelpTopic "Date/Time Axes"

and read that section and the next section, "Custom Date Formats".


I am trying to do a similar thing with over one hundred waves - convert them from text to number wave. i would appreciate anyone who could tell me the error of my ways

If I use explicit names then things work as described in the earlier post above eg.

Make /D /N =(eventsLen) FFTnumb = str2num(FFTnum)

where eventlen is a variable FFTnumb is to be the new wave and FFTnum is the original one

I have old and new names that have been generated in do loop

j = 0
do
newName = prefix2 + num2str(j)
oldname = prefix1 +num2str(j)
Make /D /N =(eventsLen) $newName = str2num($oldName)
j+=1
while (j <= 99)

where prefix1 and prefix2 are strings

Thnaks
Mike,

Looking at your code, I think the problem is that you need to declare the Wave. At the moment you are making a wave where every point is the value of the the wavename being converted to a number.
Try:
j = 0
do
newName = prefix2 + num2str(j)
oldname = prefix1 +num2str(j)
Wave/z oldWave = $oldName
Make /D /N=(eventsLen) $newName = str2num(oldWave)
j+=1
while (j <= 99)


Presumably you specify prefix1, prefix2 and eventslen somewhere else.