Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

.dat fto .csv output file conversion


graywacke Dec 23, 2012 02:03 PM

I got a running program that send weather data every hour to our ftp server but the file format being uploaded in our server is a .DAT file and we need the file to be in .CSV extension, is there a command line that can be inserted in the logger program that will automatically have the output file in .CSV format?

Also, how can i append a time stamp on the file name being uploaded in our ftp server so I can have an ease in browing file on the time and date I want?

I'm hoping that you can give me ideas to solve this issues. Thanks


aps Dec 24, 2012 12:32 PM

The TOA5 format is in the CSV format but for historical reasons we used the ".DAT" suffix. If you ammend the name of the file you save the file to on your ftp server to .CSV from .DAT you should find Excel or whatever will open the file OK.

In terms of renaming the file, we should be adding options to make this easier in later operating systems, meanwhile, you would need to write a little code to embed the time/date of the file into the filename.

One quick way of getting the data/time of a file in the logger into a string is to do something like this:

filedate = Secssince1990( FileTime (filen),4)

Where filen is the name of the file (on the logger) and filedate is defined as a string. You can use the variable filedata as the basis of the name to use for the ftp server file, after cropping or changing the name to remove detail or reserved characters (from the time field).


MarieBlur Apr 5, 2018 02:32 PM

Hi,

I can suggest you try the online tool on altoconvertpdftoexcel.com. I always use it at my work. I'm not sure whether it works for your purpose but at least you can try it.


Sam Apr 5, 2018 06:33 PM

Use the option / format of 1008 and then supply the file name with timestamp. 

Public LoggerTemp, BattV

Public ftpResult
Public fileName As String * 32
Public rTime(9) As Long
Alias rTime(1) = year,month,dayOfMonth,hour,minute,second,microSecond,weekDay,dayOfYear

DataTable (Test,1,-1)
  DataInterval (0,60,Sec,10)
  Minimum (1,BattV,FP2,False,False)
  Sample (1,LoggerTemp,FP2)
EndTable

BeginProg
  Scan (10,Sec,0,0)
    PanelTemp (LoggerTemp,250)
    Battery (BattV)
    CallTable Test
  NextScan

  SlowSequence
  Scan (1,Min,3,0)
    RealTime(rTime)
    Sprintf(fileName,"test_%04d-%02d-%02d-%02d.csv",year,month,dayOfMonth,hour)
    ftpResult = FTPClient ("myftp.com","user","pass","Test",fileName,2,0,1,Hr,1008,3000)
  NextScan
  EndSequence

EndProg

 

Log in or register to post/reply in the forum.