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 for Programming
 LabTalk Forum
 How to import the date of creation

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
verv Posted - 11/09/2017 : 09:22:07 AM
Origin Ver. and Service Release: OriginPro 2017 SR0
Operating System: Windows 8.1

Hello. I'm importing multiple .opj files through the following script. Through the manual clicking in project explorer I can access the date of creation of files that i'm importing. Is there a way to copy/import such date to the columns comment in the final file?


string sFiles$;
{dlgfile g:="*.opj" multi:=1 fname:=sFiles$;}
if (sFiles.GetLength() > 0)
{
	for (int ii = 1; ii <= sFiles.GetNumTokens(CRLF); ii++)
	{
		string sFile$ = sFiles.GetToken(ii)$;
		sFile$=; 
		impOPJ fname:=sFile$ info.wkspage:=Default1 info.wks:=Data_S1 info.cols:={1,2,3,4,5} options.FirstMode:=1;
	}
type (the end of the import);
}
8   L A T E S T    R E P L I E S    (Newest First)
nick_n Posted - 11/11/2017 : 10:54:38 AM
Hi,
Sorry for confusing, I didn't catch your problem.
In order to get such kind of data you need to use OriginC.

GetFileAttributesEx http://www.originlab.com/doc/OriginC/ref/GetFileAttributesEx
or
GetFileModificationDate http://www.originlab.com/doc/OriginC/ref/GetFileModificationDate
BR,

Nikolay
verv Posted - 11/11/2017 : 07:14:28 AM
Hi.
But again.
impTree.Info.FileDate$ =; return FileDate, the thing that I called as System date and which is the date of last saved modification of file. However, the date that I want is another one. Date of creation of .opj file. From now on I will think that this information is lost in the importing, maybe it will change in the future versions of program.

Nikolay, thanks for the efforts.
nick_n Posted - 11/10/2017 : 12:48:04 PM
Hi,
impTree.Info.FileDate$ =;
insread of impTree.Info.ImportDate$=;
Best,

Nikolay
verv Posted - 11/10/2017 : 12:04:37 PM
quote:
Originally posted by nick_n

Hi Verv,

That should help you (run after import):

Tree impTree;
impinfo trInfo:=impTree;
impTree.Info.ImportDate$=;




Nope. It shows me the time of import which is the same to the creation of the final file. But I want the time of creation of original .opj from which I'm importing.
I think that it simply can be unaccessible through the imp trees.
nick_n Posted - 11/10/2017 : 11:31:05 AM
Hi Verv,

That should help you (run after import):

Tree impTree;
impinfo trInfo:=impTree;
impTree.Info.ImportDate$=;

Good luck,

Nikolay
verv Posted - 11/10/2017 : 08:23:38 AM
It was exactly what I needed, now I can access and import the file time. It solved my problem in first approximation, however maybe it can be solved better.
So
While accessing date through page.info.system.import.filedate or something similar, I access the system date - date at which it was changed the last time. However, in case of .opj, manually two types of date can be seen (in the project explorer): modification date (the same as system date) and creation date. Is there a way to access that second, creation date of the imported .opj?
verv Posted - 11/10/2017 : 04:22:57 AM
quote:
Originally posted by nick_n

Hi,

Hope it helps:
page.info.system.import.filedate=;
http://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata

BR,

Nikolay



Thanks, it was exactly what I needed.
nick_n Posted - 11/09/2017 : 2:10:45 PM
Hi,

Hope it helps:
page.info.system.import.filedate=;
http://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata

BR,

Nikolay

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