Batch/mass-convert EDAT3 files to CSV
Dear PST Product service & support, dear users,
i'm supporting an automatisation evaluation of eprime edat3 Files. We have a license and all the associated tools.
I googled and searched the forum, but didn't find anything:
Our problem right now:
We have ~500 edat3 files, which we need to be converted to -> CSV as a single dataset. (no merge -> one edat3 -> one csv file for further working on)
I know that merging has a purporse, but in our use case the converted CSV will be evaluated as one file => result and then we merge this later.
Is there any way to do this besides opening the edat3 file with edata-aid and saving? this would be time consuming :/
I just found this:
https://github.com/tsalo/convert-eprime
Edit: i tested it and it doesn't work with edat3 files.
Thanks in advance.
Best Regards
Tim Rachul
-
Well that Python script certainly is an interesting find. I suppose one might adapt it to work with edat3 files. As far as I can tell, little or nothing has changed in the edat file format from 2 to 3, other than changing the file extension from edat2 to edat3.
Other than developing your own software tool to do the mass conversion, you might have to convert each file individually using E-DataAid 3. Might turn out to be the same amount of labor either way, but it might help the community if you developed the batch conversion tool and released it.
-
I wrote a simple Windows PowerShell script to automate the conversion of edat to csv.
# Dennis Thompson UC Davis Imaging Research Center
# Escape Path Delimiters
# Remember to add Delimiter to end of path
# ControlFile is used by E-DataAid to control the command line conversion
# Location where ControlFile will be written
$ControlFile='C:\\temp\\Nback_Megan\\ControlFile.txt'
# Where to write output files
$OutPutLoc='C:\\temp\\Nback_Megan\\converted\\'
# Where RAW edat files are located
$EdatLoc='C:\\temp\\Nback_Megan\\'
# Filter used to select files
$EdatFilter='*.edat2'
# E-DataAid Location
#$DataAid='C:\Program Files (x86)\PST\E-Prime 2.0\Program\E-DataAid.exe'
$DataAid='C:\Program Files (x86)\PST\E-Prime 2.0\Program\'
# DataAid Options
$Options='/e /f'
$files=get-childitem $EdatLoc -include $EdatFilter -nameForEach($infile in $files){
# get the base name of the edat file
$foo = $infile.split(".")
$newname = $foo[0]
# output name of file being converted
echo $infile
$strings=@()
$strings+="Inheritance=NULL"
$strings+="InFile=$EdatLoc$infile"
$strings+="OutFile=$OutPutLoc$newname.csv"
$strings+="ColFlags=1"
$strings+="ColNames=1"
$strings+="Comments=1"
$strings+="BegCommentLine="
$strings+="EndCommentLine="
$strings+="DataSeparator=,"
$strings+="VarSeparator=,"
$strings+="BegDataLine="
$strings+="EndDataLine="
$strings+="MissingData=NaN"
$strings+="Unicode=0"
$strings | Set-Content -Path $ControlFile
#Get-Content -Path $ControlFile
start-process "E-DataAid.exe" -ArgumentList "$Options $ControlFile" -Wait -WorkingDirectory "$DataAid"
$filedata = Get-Content "$OutPutLoc$newname.csv"
#$filedata[4..($filedata.length - 1)] | sc "$OutPutLoc$newname.txt" -Encoding ASCII
$filedata[4..($filedata.length - 1)] | Set-Content -Path "$OutPutLoc$newname.csv"}
-
Very nice -- I never thought about running E-DataAid as a command-prompt program. Now I see that this is documented at https://support.pstnet.com/hc/en-us/articles/360020316014-INFO-Using-E-DataAid-exe-with-Command-Line-Interpreters-25323-
Please sign in to leave a comment.
Comments
4 comments