The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Default Time Display

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
elpado6872 Posted - 11/27/2016 : 04:56:00 AM
Hi everybody, my name is Francesco, I'm a PhD student in Physics. I immediately apologize if I missed some of the forum steps, like presentation, but I didn't find specific rules.

Anyway I have a question about how to set up OriginPro 2015. My data is saved as .txt file and the column labelled Time contains time stamps saved in the following format HH:mm:ss.###. When I drag and drop my .txt file Origin recognizes that that particular column is Time and it sets the column to a Time format, which is fine. The problem is that the default display is HH:mm which means that every time I need to change it manually to HH:mm:ss.###

Is there any way to change the default time display? It would be very handy for me because my .txt file contains different time columns and every time I need to change all of them manually. Thanks

Francesco
3   L A T E S T    R E P L I E S    (Newest First)
JacquelineHe Posted - 11/29/2016 : 04:05:52 AM
Hi,

About your question, I impove the Labtalk script.
Firstly, get the imported worksheet column number, use the loop script to go through the worksheet, and check if the column format is "Time", change the display to "HH:mm:ss.### "


int ncols = wks.ncols; //get worksheet column number
for(int ii = 1; ii<ncols; ii++)
{
if (wks.col$(ii).format == 3)
{
wks.col$(ii).subformat = 11; 
}
}



Thanks
OriginLab
Jacqueline
elpado6872 Posted - 11/28/2016 : 10:23:11 AM
Thank you very much Jacquline! That is really helpful and works great for the first column. What if I have a time column also at the 6th column, or 11th column? Something that is not always constant. Is it possible to include a code that recognizes if a column is time and sets that column to HH:mm:ss.###? Because when I drag and drop Origin already recognizes all the columns that are time columns, but it sets them as HH:mm. Can I change that behaviour with some kinf od if statement? Thank you very much!

Francesco
JacquelineHe Posted - 11/28/2016 : 06:09:49 AM
Hi,

When you drag and drop a file into Origin, it will use default template and filter to import your file.
So I suggest you can new a filter with import after script to edit the column format.
For example:

wks.col1.format = 3;  // Set the first column format to Time, Time = 3
wks.col1.subformat = 11; // Display Time format HH:mm:ss.###



1. Select " Tools: Import Filters Manager" in the menu.
2. In the "Filter Manager" dialog, choose "ASCII" filter, and click on "Edit" button.
3. In the filter edit dialog, set the "File Name Filter" to "*.txt"
And copy and paste the above labtalk script to the "Labtalk Script after Import" text box.
4 "Save As" the filter in the "Filter" Folder under User File Folder. Close the dialog.



After that, when you import the txt file, the "Select Filter" dialog will pop-up.
You can choose the new filter for importing the file, and the first column will be set to Time format, and display to "HH:mm:ss.###"

Thanks
OriginLab
Jacquline

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000