Solved Batch Rename - Epoch Time to Human Time

March 18, 2013 at 01:50:37
Specs: Windows XP
hi, I have a bunch of htm files (B1-60164.htm, B1-60165.htm, etc.) with runs a javascript to convert epoch time to normal human time.

i managed to determine the script call (not the actual js):

<SCRIPT language="JavaScript">document.write(format_date(1364400000));</SCRIPT>

my intention is to extract the epoch time 1364400000 and convert it into yymm date format, and append to the filename (1303_B1-60164.htm, 1303_B1-60165.htm, etc.)

fyi: epoch time 1364400000 is 18 March 2013, GTM+8.

in short, extract the epoch time within htm files, convert to human time, and append yymm (year+month) to the filename.

this is via Windows batch script/command.

thanks!


See More: Batch Rename - Epoch Time to Human Time

Report •

✔ Best Answer
March 23, 2013 at 11:57:05
Yeh, at one point it occured to me it might be something to do with date format, but the line# (that got the error) threw me off the scent. (Seriously! I'm not just covering!)
At any rate, vbscript has functions that might handle this, and also M2's approach, but that requires debug, and 64-bit machines don't support debug. Try this snippet/test on your system and see if it gets it right:
'==== begin vbscript datest
z=date
call test()
wscript.echo "enter a test date: "
z=wscript.stdin.readline
call test()

sub test()
wscript.echo z
e=formatdatetime(z)
wscript.echo e
d=datepart("d",z)
m=datepart("m",z)
y=datepart("yyyy",z)
wscript.echo "year:",y," ",right("20"&y,2)
wscript.echo "month: ",m," ",right("0"&m,2)
wscript.echo "day: ",right("0"&d,2)
'==== end vbscript
Here's my last posted vbscript amended to implement this. Hopefully it can handle regional settings since it accesses the system to get the settings:

'===== begin vbscript "ep.vbs"
set regx=new regexp
regx.global=true
'======== date decipher
regx.pattern="[^0-9]"
'-- get the delimiter
dlm=regx.execute(date)(0)
'-- determine position of year element (leading or trailing)
ye=datepart("yyyy",date)
x=dateadd("yyyy",1,date)
k=split(x,dlm)
for i=0 to 2
if k(i)-ye=1 then exit for
next
'-- month and day position don't matter since they're both "1"
base="1"&dlm&"1"
if i=2 then base=base&dlm&"1970" else base="1970"&dlm&base
'------ end date-decipher, begin main body
set fso=createobject("scripting.filesystemobject")
infile=wscript.arguments(0)
z=fso.opentextfile(infile,1).readall
'this is to skip html files with no 10-digs
on error resume next
regx.pattern="[^0-9][0-9]{10,10}[^0-9]"
zz=mid(regx.execute(z)(0),2,10)/86400
x=err.number
err.clear
if x=0 then
nn=dateadd("d",zz,base)
yy=right("20"&datepart("yyyy",nn),2)
mm=right("0"&datepart("m",nn),2)
a=yy&mm
wscript.echo "fso.movefile "+infile+","+wscript.arguments(2)+a+"_"+wscript.arguments(1)
c=wscript.stdin.readline 'testing
if c="r" then 'testing
fso.movefile infile,wscript.arguments(2)+a+"_"+wscript.arguments(1)
end if 'testing
end if
'===== end vbscript
this one stops before each actual rename, and you can choose to skip (for testing), or execute the rename by entering "r". Just hit ctrl-C to stop the run at any point. For production purposes, just remove the three lines around the movefile function.



#1
March 18, 2013 at 03:24:50
So you need to get the epoch time from the html, convert it with js?
And the bat will get the h time from js?

=====================
M2 Golden-Triangle


Report •

#2
March 18, 2013 at 05:39:32
hi Mechanix2Go,

no js required.

i'm looking for a batch to get the epoch time from the html and convert it to human date/time (yy and mm will do).

then rename that html file with yymm append to it --> yymm_filename.html

thanks!


Report •

#3
March 18, 2013 at 06:07:07
Post a few lines, including the one with e-time.

=====================
M2 Golden-Triangle


Report •

Related Solutions

#4
March 18, 2013 at 06:09:11
here's one of the line:

<SCRIPT language="JavaScript">document.write(format_date(1364400000));</SCRIPT>


Report •

#5
March 18, 2013 at 07:26:30
Whose epoch are we talking about here? At first I assumed UNIX, but 1364400000 seconds from January 1, 1970 is March 27, 2013.

Also, include the source for this "format_date()" function.

How To Ask Questions The Smart Way


Report •

#6
March 18, 2013 at 15:52:00
hi Razor2.3,

date difference could be timezone difference. nvm about it.

I'm interested on the year+month (yymm) only.

function format_date(utc_date) {
	var dt = new Date(utc_date * 1000);

	// parse string and output Month Date Year
	// Output from toString is of the following format
	// "Day Month Date Time Zone Year"
	//var dtarr = dt.toString().split(' ');
	//return dtarr[2] + '/' + dtarr[1] + '/' + dtarr[3] + '/' + dtarr[4] + '/' + dtarr[5];
							
	var curr_date = dt.getDate();
	if (curr_date < 10) curr_date = "0" + curr_date;
							
	var curr_month = dt.getMonth();
	curr_month++;
	if (curr_month < 10) curr_month = "0" + curr_month;
							
	var curr_year = dt.getFullYear();
	return curr_date + "/" + curr_month + "/" + curr_year;
							
	}


Report •

#7
March 18, 2013 at 19:16:45
I think there's still some problem, since gmt can only vary by 24 hours, but fwiw, here's something. It's very slow (one minute), but, that's batch for you.
(vbscript could fix it in one line and under one second, i believe.)
::==== begin batchscript
@echo off & setlocal
:: first, try to isolate the value out of the html
for /f "tokens=3 delims=()" %%a in ('findstr /r /i "script language=\"javascript\">document.write(format_date(" xx.html') do set ep=%%a
echo value obtained: %ep%
set /a sub=ep/86400

::based on previous comments
set month=1
set day=1
set year=1970

set /a leap="year%%4"
::performance evaluation: VERY BAD
echo %time%
for /L %%a in (1 1 %sub%) do call :adddate
if "%month:~1%"=="" set month=0%month%
if "%day:~1%"==""set day=0%day%
set ddate=%month%%dlm%%day%%dlm%%year%
echo finished: %ddate%
::performance evaluation, result: EVEN WORSE!
echo %time%
goto :eof

:adddate
set /a day+=1
set test=31
call :%month% 2>nul
if %day% gtr %test% (
set day=1
set /a month+=1
)

GOTO :EOF

:4
:6
:9
:11
set /a test-=1
goto :eof

:12
if %day% equ 32 (
set /a year+=1
set /a leap=year"%%"4
set day=1
set month=1
)
goto :eof

:2
if %leap% equ 0 (set test=29) else (set test=28)
:: or: set /a test=28+3/((leap+1)*3)
goto :eof
::==== end batchscript
maybe it's my codeing, but this seemed really slow. "sort-of" tested, still coming up with 3/27/13 though.


Report •

#8
March 19, 2013 at 09:54:37
So you want a script that scans HTML files for an integer representing a UNIX date, convert it to Gregorian, and use that to rename the file? It's viable for either VBScript or Powershell, but I'd need the actual js line that has the date.

How To Ask Questions The Smart Way


Report •

#9
March 19, 2013 at 15:35:15
that's correct.

if batch cmd tedious, vbscript would be fine too.


btw, 1st post and #4 has the js line has the unix date.


Report •

#10
March 19, 2013 at 18:06:51
Here's a hybrid approach:
:: begin batchscript
@echo off & setlocal
for /f "tokens=3 delims=()" %%a in ('findstr /r /i "<script language=\"javascript\">document.write(format_date(" test.d') do set /a ep=%%a/86400
for /f "tokens=1-3 delims=/" %%a in ('cscript de.vbs %ep% 1/1/70') do (
set month=0%%a
set yr=%%c
)
echo ren xx.htm %yr:~-2%%month:~-2%_xx.htm
::=== end batch

'begin vbscript "de.vbs":
wscript.echo dateadd("d",wscript.arguments(0),wscript.arguments(1))
'end


Report •

#11
March 19, 2013 at 18:28:30
hi nbrane,

thanks for sharing.

can the findstr search the first occurrence of 10-digits in the html file?

for this examepl, the unix date is 1364400000.


reason is that i observed the the way the html was generated; "<script language=\"javascript\">document.write(format_date(" is not in a single continuous line. it has many blank spaces and carriage/next line too.

findstr to target only 10-digits string would make more sense.

thanks!


Report •

#12
March 19, 2013 at 21:00:41
Yeh, I wondered about that, too. As long as the 10 digits are an "assured" or firm target, I think this will work.:
::===== batch snippet
for /f "tokens=3 delims=()" %%a in ('findstr /r "[^0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][^0-9]" xx.htm') do set /a ep=%%a/86400
echo ep %ep%
::=== end snippet
it's long, but it seems to work (that's what she said! well, I can dream on...)

Report •

#13
March 19, 2013 at 21:10:15
hi nbrane,

do i need to include the vbscript too?

or the snippet above can work standalone?

p/s: I'm getting "ep 0" from the echo output


Report •

#14
March 20, 2013 at 12:51:27
@david, no. Here's the full (amended) script:
@echo off & setlocal
set infil=%1
if not defined infil set infil=test.htm
for /f "tokens=3 delims=()" %%a in ('findstr /r "[^0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][^0-9]" %infil%') do set /a ep=%%a/86400
if not defined ep echo problem & goto :eof
echo ep %ep%
for /f "tokens=1-3 delims=/" %%a in ('cscript de.vbs %ep% 1/1/70') do (
echo %%a %%b %%c
set month=0%%a
set yr=%%c
)
echo month %month% year %yr%
echo ren xx.htm %yr:~-2%%month:~-2%_xx.htm
::===== end batchscript

and yes, the vbscript is the key to doing the date math:
'===== begin vbscript "de.vbs" (you only need this next line)
wscript.echo dateadd("d",wscript.arguments(0),wscript.arguments(1))
'end

And you did fix the filename (xx.htm) that I used as a placeholder? (i changed it to "test.htm" in this version, overrideable from the commandline as %1)
Other than that, it should work, as long as the file exists and it has a 10-digit number in it. My tests worked fine, and excluded both 9 and 11-digit numbers.
And, as written, the batch requires that there be two "fields" (delimited by parentheses) in front of the number, like: nnn(zzz(1234567890
If that creates a problem, it can maybe be fixed.


Report •

#15
March 20, 2013 at 16:40:12
thanks nbrane ...

tested the batch. echoed "problem".

i think there is a little problem with the delimiter in FOR command.

i peeked in the html, there are many empty spaces before & after the unix date number.

<SCRIPT language="JavaScript">
                                                                    document.write(format_date(
                                                                    1366473600
                                                                    ));
                                                                </SCRIPT>

i have no idea why it was written/programmed such way. but that what's inside the html.

would it be better/easier to just extract the 10-digits number, without any delimiter/token setup in FOR command?


Report •

#16
March 20, 2013 at 18:32:01
If the 10-dig always appears on a line by itself, maybe, but if that varies, then no, not reliably with batch (findstr), but vbscript might using regexp.
The spaces don't matter (to batch), but the line-breaks do. You can try for yourself (since you have the collection of files), just change:
"tokens=3 delims=()"
to:
"tokens=*"
and see what you get. Take delims out, make tokens *

Report •

#17
March 20, 2013 at 18:38:55
not working.

i even tried a simple TXT file, with the content: aaa bbb ccc 1366473600 test test

using tokens=*

getting "Missing Operator", ep 0


Report •

#18
March 20, 2013 at 19:36:16
That was my fault, for trying to jump steps ("set /a ep=%%a/86400") since %%a may or may not be our target (at this point - i thought it was, but...)
Findstr (what batch uses for limited regexp) doesn't discriminate well when faced with inconsistant line formats, because it's line-break-based. So, that said, I guess it's best to use vbscript or another higher language (powershell etc). Here's vbscript approach:
'===== begin vbscript "ep.vbs"
set regx=new regexp
regx.global=true
set fso=createobject("scripting.filesystemobject")
z=fso.opentextfile(wscript.arguments(0),1).readall
regx.pattern="[^0-9][0-9]{10,10}[^0-9]"
set matches=regx.execute(z)
for each match in matches
wscript.echo mid(match.value,2,10)
next
'===== end vbscript
to try this out:
CSCRIPT EP.VBS test.htm
where of course test.htm is anything you want to try it on. I'll wait for another shoe to drop before proceeding - this will just (hopefully) echo the number regardless of its context in the file.
cscript

Report •

#19
March 20, 2013 at 20:06:28
finally!

the vbs managed to extract all 10-digits numbers in the html.

next steps:
1) only extract FIRST instance of the 10-digit numbers. ignore the rest.
2) convert to gregorian date.
3) rename file with yymm_ append to the filename.

if successful, then the script can be enhanced to batch rename all html files in folders (recursively rename)...

e.g.

current folder (where the vbs is stored)
|--folder [aaaa]
|----file1.html
|----file2.html
|----etc.
|--folder [bbbb]
|----file1.html
|----file2.html
|----etc.


thanks!


Report •

#20
March 20, 2013 at 22:55:26
@echo off & setlocal
for /f "tokens=*" %%a in ('dir /b /s *.htm') do (
cscript ep.vbs "%%a" "%%~nxa" "%%~dpa"
pause
)
::====== end batchscript
'===== begin vbscript "ep.vbs"
set regx=new regexp
regx.global=true
set fso=createobject("scripting.filesystemobject")
infile=wscript.arguments(0)
z=fso.opentextfile(infile,1).readall
'this is to skip html files with no 10-digs
on error resume next
regx.pattern="[^0-9][0-9]{10,10}[^0-9]"

zz=mid(regx.execute(z)(0),2,10)/86400
x=err.number
err.clear
if x=0 then
n=split(dateadd("d",zz,"1/1/70"),"/")
a=right("0"+n(0),2)+right(n(2),2)
wscript.echo "fso.movefile "+infile+","+wscript.arguments(2)+a+"_"+wscript.arguments(1)
fso.movefile infile,wscript.arguments(2)+a+"_"+wscript.arguments(1)
end if
'===== end vbscript


Report •

#21
March 21, 2013 at 16:23:35
yep, tthat doesnt work.

listing the html doesnt work as u need to jump into each folder and scan them.

thanks for ur help!


Report •

#22
March 21, 2013 at 18:49:38
see edited post #20. It had errors, but now it works on my tests.

Report •

#23
March 21, 2013 at 19:46:01
hi nbrane,

not working.

1) all files renamed to %dpa_filename.html.
2) would it be possible not to move the files outside of its own folder? meaning, retain the same folder for the renamed files.

currently, all renamed files are moved out to the root folder (where the script is called).

thanks!


Report •

#24
March 21, 2013 at 20:10:43
Oh, Crap, I left out a tilde! (in the batch):

for /f "tokens=*" %%a in ('dir /b /s *.htm') do (
cscript ep.vbs "%%a" "%%~nxa" "%%~dpa"
pause
)

Note the tilde in the third quoted item. Also, yes, the files will be left "in-place" and only renamed (I realize the "fso.movefile" can be mis-construed, but it is only a rename function, in this case, like cmd "move".) Keep me posted, I think we're almost there...


Report •

#25
March 21, 2013 at 20:29:22
hmm, the renamed files doesnt contain the yymm prefix.

output after rename: _filename.html


Report •

#26
March 21, 2013 at 22:03:18
I don't know... it worked over here, but try putting some output into the vbs, at this point in the vbs code:
n=split(dateadd("d",zz,"1/1/70"),"/")
a=right("0"+n(0),2)+right(n(2),2)
'----- add these outputs to check progress
wscript.echo "n:"+n(0)+" "+n(2)
wscript.echo "a:"+a

var "a" is the one that's gone awol, that's the one that needs to be corralled. If var "n" fails to deliver, then we back up a step or two and look at the source data...
I disabled error-handling, as well ("on error resume next"), so you might also try removing or neutralizing that line, because those error messages can be quite helpful.
I did that to skip any html files that did not contain 10-digit numbers.


Report •

#27
March 21, 2013 at 23:02:56
ok... gotten this:

ep.vbs(16, 1) Microsoft VBScript runtime error: Subscript out of range: '[number: 2]'

i dont see any output for variable 'n', but var 'a' is empty.


Report •

#28
March 22, 2013 at 17:53:47
Hello David: It looks to me like the batchfile got crossed up, because it's not delivering three elements, only two. Pls check your batchfile against post #20 and make sure all three items are being sent:
cscript ep.vbs "%%a" "%%~nxa" "%%~dpa"

I dropped the third element, in my tests, and got the same error as you show.
Sorry for this epic ("epoch"?) drama - I seem to suffer from this affliction quite often ;-)


Report •

#29
March 22, 2013 at 18:09:19
no worries, nbrane, you've been helpful ;)

i did follow against post #20 earlier. and retested it again, same issue.

it seems the batch is working fine (i guess).

it echo-ed out %%a (filename + fullpath), %%~nxa (filename+ext only), %%~dpa (fullpath only).

so i guess the 3 elements were captured, but not thru ep.vbs.


Report •

#30
March 22, 2013 at 19:16:22
Quite a conundrum... I guess next step is in the vbs, any line near top:
wscript.echo "arg count: ",wscript.arguments.count
for i=0 to wscript.echo wscript.arguments.count-1
wscript.echo i,wscript.arguments(i)
next
'this is just a "pause"
aa=wscript.stdin.readline

and let me know what transpires of this probe.


Report •

#31
March 22, 2013 at 19:24:04
i put the lines at the top ... getting "..ep.vbs(4, 25) Microsoft VBScript compilation error: Expected end of statement"

Report •

#32
March 22, 2013 at 20:08:42
I'm such a dufus, sorry:
change:
for i=0 to wscript.echo wscript.arguments.count-1
to:
for i=0 to wscript.arguments.count-1

I'll be up for another hour or so, so I'll keep tabs...


Report •

#33
March 22, 2013 at 20:54:20
seems good here...

arg count: 3
0 C:\Users\Administrator\Desktop\a\aaa\a.txt
1 a.txt
2 C:\Users\Administrator\Desktop\a\aaa\


Report •

#34
March 22, 2013 at 21:54:35
At this point, I'm clueless, since all three elements are defined. If ws.args(2) exists, then why would the script bomb with the aforesaid error? (somewhat-hetorical q.)
Try the same sequence, right before the error-point:


if x=0 then
n=split(dateadd("d",zz,"1/1/70"),"/")
a=right("0"+n(0),2)+right(n(2),2)
wscript.echo "arg count: ",wscript.arguments.count
for i=0 to wscript.arguments.count-1
wcript.echo i,wscript.arguments(i)
next
wscript.echo "fso.movefile "+infile+","+wscript.arguments(2)+a+"_"+wscript.arguments(1)
fso.movefile infile,wscript.arguments(2)+a+"_"+wscript.arguments(1)
end if


I know this is lame, but I'm out of resources here. Works on my end, and everything fits, so ? I'll back online tomorrow...


Report •

#35
March 23, 2013 at 01:19:56
strange indeed.

here's what i got:

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

arg count:  3
fso.movefile C:\Users\Administrator\Desktop\a\aaa\a.txt,C:\Users\Administrator\D
esktop\a\aaa\_a.txt


Report •

#36
March 23, 2013 at 01:42:09
ok, i managed to identify the root-cause of the error.

it seems the script works fine, but unable to split the converted date by "/".

i thought of this because the dateadd add zz variable (day count from the converted date) from 1/1/70 (start of epoch date) <-- this should results the current date.

then i did a quick test. i changed n=split(dateadd("d",zz,"1/1/70"),"/") to n=split(dateadd("d",zz,"1/1/70"),".")

after changing this, i managed to get the output 2013_filename.html. the date order is wrong. 2013_filename = dayyear_filename.

other examples: 1400142882 = 1514_filename (day=15,year=2014) <-- should be 1405_filename (year=14,month=05).


now this regional date setting is tricky (same as the way Excel handle date format) as not everyone has the same settings. if the script is set to my own regional date format, the script will not work for others :)

anyways, here's my current regional date format (for you reference):

The current date is: 23.03.2013

day (dd), month (mm), year (yyyy), separated by decimal (.)


phew!


Report •

#37
March 23, 2013 at 11:57:05
✔ Best Answer
Yeh, at one point it occured to me it might be something to do with date format, but the line# (that got the error) threw me off the scent. (Seriously! I'm not just covering!)
At any rate, vbscript has functions that might handle this, and also M2's approach, but that requires debug, and 64-bit machines don't support debug. Try this snippet/test on your system and see if it gets it right:
'==== begin vbscript datest
z=date
call test()
wscript.echo "enter a test date: "
z=wscript.stdin.readline
call test()

sub test()
wscript.echo z
e=formatdatetime(z)
wscript.echo e
d=datepart("d",z)
m=datepart("m",z)
y=datepart("yyyy",z)
wscript.echo "year:",y," ",right("20"&y,2)
wscript.echo "month: ",m," ",right("0"&m,2)
wscript.echo "day: ",right("0"&d,2)
'==== end vbscript
Here's my last posted vbscript amended to implement this. Hopefully it can handle regional settings since it accesses the system to get the settings:

'===== begin vbscript "ep.vbs"
set regx=new regexp
regx.global=true
'======== date decipher
regx.pattern="[^0-9]"
'-- get the delimiter
dlm=regx.execute(date)(0)
'-- determine position of year element (leading or trailing)
ye=datepart("yyyy",date)
x=dateadd("yyyy",1,date)
k=split(x,dlm)
for i=0 to 2
if k(i)-ye=1 then exit for
next
'-- month and day position don't matter since they're both "1"
base="1"&dlm&"1"
if i=2 then base=base&dlm&"1970" else base="1970"&dlm&base
'------ end date-decipher, begin main body
set fso=createobject("scripting.filesystemobject")
infile=wscript.arguments(0)
z=fso.opentextfile(infile,1).readall
'this is to skip html files with no 10-digs
on error resume next
regx.pattern="[^0-9][0-9]{10,10}[^0-9]"
zz=mid(regx.execute(z)(0),2,10)/86400
x=err.number
err.clear
if x=0 then
nn=dateadd("d",zz,base)
yy=right("20"&datepart("yyyy",nn),2)
mm=right("0"&datepart("m",nn),2)
a=yy&mm
wscript.echo "fso.movefile "+infile+","+wscript.arguments(2)+a+"_"+wscript.arguments(1)
c=wscript.stdin.readline 'testing
if c="r" then 'testing
fso.movefile infile,wscript.arguments(2)+a+"_"+wscript.arguments(1)
end if 'testing
end if
'===== end vbscript
this one stops before each actual rename, and you can choose to skip (for testing), or execute the rename by entering "r". Just hit ctrl-C to stop the run at any point. For production purposes, just remove the three lines around the movefile function.


Report •

#38
March 23, 2013 at 20:17:53
getting error for datest

C:\Users\Administrator\Desktop\a\datest.vbs(18, 19) Microsoft VBScript compilation error: Expected 'End'

i tried my luck adding end sub to the vbs :)

here's what i got:

24.03.2013
24.03.2013
year: 2013 13
month: 3 03
day: 24

enter a test date:
05/29/2013
05/29/2013
29.05.2013
year: 2013 13
month: 5 05
day: 29

seems like date formatting is working fine (EU/US format with . or / separator)


however getting error for ep.vbs

C:\Users\Administrator\Desktop\a\ep.vbs(1, 1) Microsoft VBScript compilation error: Expected statement


Report •

#39
March 23, 2013 at 21:18:51
Wow, am I jinxed on this one! Delete or disable that first line, (ep.vbs) it was a comment (vbscript comments always have ' as first char., somehow I lost it in transition.)
Fixed in post #37
Good catch, in both (last two of my lame) posts!

Report •

#40
March 24, 2013 at 01:36:54
:) almost there.

i noticed a=mm+yy is reversed, so i changed it to a=yy+mm instead.

after this change, the year seems to have a "3" added instead of "1" ....and month is missing "0" for single-digit month.

examples:

23 Mar 2013 date has 333_filename <-- expecting 1303_filename
02 Jul 2015 date has 357_filename <-- expecting 1507_filename
24 Dec 2014 date has 3412_filename <-- expecting 1412_filename


Report •

#41
March 24, 2013 at 11:58:32
I got my concatenation operators messed up (used "+" instead of "&" in lines 30,31 & 32) Rather than repost the entire script ("my, how it's grown!") to fix 3 bytes, I've amended post 37 script (also fixed the order of yymm). I should have "back-pasted" the script onto my system for trial, but neglected to do so yesterday. I did back-paste it today, and ran it using your date format of dd.mm.yyyy, as well as reversed (yy.mm.dd) and it performed "as advertised". I believe it is good-to-go now! (it only took me 40 posts to get it right!)

Report •

#42
March 24, 2013 at 17:25:56
hell yeah! works flawlessly!!!!!!!!!! :)

thanks nbrane!


Report •

#43
April 4, 2013 at 01:05:39
hi nbrane,

i have a follow-up question to this. something just crossed my mind ;)

the solution provided earlier at post #37 will extract the FIRST 10-digit number from the file.

i'm wondering... can the script be modified to extract n-th numbers?

for example, extract the SECOND 10-digit number or FIFTH 10-digit number?


thanks


*EDIT: scratch that. i've found where to manipulate the index of the extract list of numbers.

-> zz=mid(regx.execute(z)(0),2,10)/86400

changing (0) to (1) will extract 2nd 10-digit number.


Report •

Ask Question