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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 How to import the date of creation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

verv

9 Posts

Posted - 11/09/2017 :  09:22:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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);
}

nick_n

Finland
125 Posts

Posted - 11/09/2017 :  2:10:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

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

BR,

Nikolay
Go to Top of Page

verv

9 Posts

Posted - 11/10/2017 :  04:22:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

verv

9 Posts

Posted - 11/10/2017 :  08:23:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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?

Edited by - verv on 11/10/2017 08:24:17 AM
Go to Top of Page

nick_n

Finland
125 Posts

Posted - 11/10/2017 :  11:31:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Verv,

That should help you (run after import):

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

Good luck,

Nikolay
Go to Top of Page

verv

9 Posts

Posted - 11/10/2017 :  12:04:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

nick_n

Finland
125 Posts

Posted - 11/10/2017 :  12:48:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
impTree.Info.FileDate$ =;
insread of impTree.Info.ImportDate$=;
Best,

Nikolay
Go to Top of Page

verv

9 Posts

Posted - 11/11/2017 :  07:14:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

nick_n

Finland
125 Posts

Posted - 11/11/2017 :  10:54:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000