Welcome, Guest. Please Login.
IRobotSoft Robot
08/07/20 at 16:50:48
News: Welcome to the IRoboSoft Visual Web Scraping and Web Automation forum.
Home Help Search Login
Google
 


Pages: 1
Send Topic Print
Saving date format (Read 3762 times)
RhoTu
IRobotSoft Newbies
*


I Love IRobotSoft

Posts: 10
Saving date format
01/26/16 at 15:35:31
 
Just starting with iRobot and learning quickly! Thanks.
 
http://biz.yahoo.com/c/s.html
 
When I scrape the table of splits the dates in the columns 'transform' to full datetimes in the 'Name Table Fields'.
However in the 'Save Variables', even though I have &get_date in the define variables 'Transformation of Value', when saved to .csv file the dates reform back to the original string.  
 
How do I get the date to save as either a date value or a formated date string?
 
TIA
Back to top
 
 
  IP Logged
IRobotSoft Administrator
IRobotSoft Administrator
*****


IRobotSoft, the Best
Internet Robot
System

Posts: 1608
Gender: male
Re: Saving date format
Reply #1 - 01/26/16 at 18:16:52
 
Can you post more information about how you did it?  If you have defined your variable with "Get a date" transformation and save the variable, it should save the values in full date format.  
Back to top
 
 

The Administrator.
WWW   IP Logged
RhoTu
IRobotSoft Newbies
*


I Love IRobotSoft

Posts: 10
Re: Saving date format
Reply #2 - 01/27/16 at 10:46:00
 
Here is the output,
 
"Payable"      "Ex_Date"      "Symbol"      "Ratio"
"Payable"      "ExDate"      ""      "Ratio"
 
"Jan 04"      "Jan 05"      "HK"      "1-5"
 
"Jan 05"      "Jan 06"      "UPIP"      "1-12"
 
"Jan 07"      "Jan 08"      "ETRM"      "1-15"
 
"&nbsp"      "Jan 08"      "SHIP"      "1-5"
 
"Jan 11"      "Jan 12"      "MTL"      "1-2"
 
"&nbsp"      "Jan 12"      "OPHC"      "1-10"
 
"Jan 22"      "Jan 25"      "AMDA"      "1-15"
 
"&nbsp"      "Jan 25"      "ADAT"      "1-9"
 
"&nbsp"      "Jan 25"      "SGOC"      "1-4"
 
Also, how do I eliminate the first row of column headers?
 
TIA
Back to top
 
  IP Logged
IRobotSoft Administrator
IRobotSoft Administrator
*****


IRobotSoft, the Best
Internet Robot
System

Posts: 1608
Gender: male
Re: Saving date format
Reply #3 - 01/27/16 at 11:00:49
 
I just ran it and it is producing the right format.  Can you check if you are running the latest version?
Back to top
 
 

The Administrator.
WWW   IP Logged
RhoTu
IRobotSoft Newbies
*


I Love IRobotSoft

Posts: 10
Re: Saving date format
Reply #4 - 01/27/16 at 11:17:52
 
version 2.8.2.2016.01.17
 
I am looking to output the dates as 01/04/2016 not "Jan 04"
 
Thank you for taking a look at this.  I am sure there is something I am missing since this is my first time trying to scrape.
 
TIA
 
Back to top
 
 
  IP Logged
IRobotSoft Administrator
IRobotSoft Administrator
*****


IRobotSoft, the Best
Internet Robot
System

Posts: 1608
Gender: male
Re: Saving date format
Reply #5 - 01/27/16 at 11:32:20
 
I just ran it and this is its output:  
 
 
"Payable"      "Ex_Date"      "Symbol"      "Ratio"
 
""      ""      ""      "Ratio"
 
"2016/01/04 00:00:00"      "2016/01/05 00:00:00"      "HK"      "1-5"
 
"2016/01/05 00:00:00"      "2016/01/06 00:00:00"      "UPIP"      "1-12"
 
"2016/01/07 00:00:00"      "2016/01/08 00:00:00"      "ETRM"      "1-15"
 
""      "2016/01/08 00:00:00"      "SHIP"      "1-5"
 
"2016/01/11 00:00:00"      "2016/01/12 00:00:00"      "MTL"      "1-2"
 
""      "2016/01/12 00:00:00"      "OPHC"      "1-10"
 
"2016/01/22 00:00:00"      "2016/01/25 00:00:00"      "AMDA"      "1-15"
 
""      "2016/01/25 00:00:00"      "ADAT"      "1-9"
 
""      "2016/01/25 00:00:00"      "SGOC"      "1-4"
 
 
Maybe you were looking at the wrong file?
Back to top
 
 

The Administrator.
WWW   IP Logged
RhoTu
IRobotSoft Newbies
*


I Love IRobotSoft

Posts: 10
Re: Saving date format
Reply #6 - 01/27/16 at 11:52:43
 
DOH!
 
Tried so many things I forgot I changed the file location.
 
Last 2 things.
 
1.  Can I eliminate the first 2 lines? Variable names and First data row which is column names?
2.  I want to delete existing data cut don't want to sort the data since if the first date field is empty it indicates it is the same as the previous row.  Sorting would lose that.  Or do I add an event that saves the previous row date and if current row date is empty use previous row???
 
If I solve these then I need to make a contribution  Grin
Back to top
 
 
  IP Logged
IRobotSoft Administrator
IRobotSoft Administrator
*****


IRobotSoft, the Best
Internet Robot
System

Posts: 1608
Gender: male
Re: Saving date format
Reply #7 - 01/27/16 at 15:27:10
 
For 1) you can use some condition to skip saving data.  
 
For 2) if you have too many customization, you may want to construct your own text content using string operations, and use saveFile function to save your result text.   Instead of saving to file, you can save to a Dataset variable to test if the record is new. saveVariable() function will return >0 if it is inserted successfully (i.e., a new record).  
 
 
Back to top
 
 

The Administrator.
WWW   IP Logged
Pages: 1
Send Topic Print