Hi everyone,
Earlier I asked about how to extract files and it is working great! Now I want to use these files, but the files are saved with ".pda-iv" (the file are coming from a parameter analyzer B1506). In my script to open the file (ronFolder = Open(directory || deviceName || "\" || "RDS-ID.pda-iv");), I get an "Error with File: Path is Invalid" error.
Is there a way to change the name of the file? For example, instead of RDS-ID.pda-iv, have it as RDS-ID.text.
Here is my code from how I extracted files:
/* 1) This script assumes all files within zipped files are text files.
2) Make sure only zipped files are in the directory (ie., only B1506A data sheet zipped files)*/
directory = Pick Directory (); //Choose directory where zipped folders are
filesInDirectory = Files In Directory(directory); //get list of files in directory
nFiles = N Items(filesInDirectory); //get number of zip files in directory
For(i=1, i<=nFiles, i++,
fileName = filesInDirectory[i]; //select ith file in list of
/********Determine Device Name***********/
pos = Contains(fileName, "_"); ///(example file name: GS66508T 65R6 #1_7-19-2016_11-04-28_AM.pda-ds)
deviceName = left(fileName,pos-1);
/****************************************/
/*******Create subdirectory for extracted files.
Make sure it is in a directory separate from all the zipped files*****/
subDir = "C:\R&D Data\TSMC\E-HEMT\GS66508T\GS66508T 65R6 extractions\" || deviceName || "\";
Create Directory(subDir);
/*************************************************************************/
za = Open(directory || fileName, zip); //Open zipped folder
dirlist = za << dir; //Get list of files in zipped folder
nZippedFiles = N Items(dirlist); //get number of files in dirlist
/*Step through dirlist and save each text file into the new sub directory*/
for(k=1, k<=nZippedFiles , k++,
If(Right(dirlist[k],4) == ".txt",
text = za << read (dirlist[k]);
Save Text File(subDir || dirlist[k], text),);
);
/************************************************************************/
);