United Nations-editing data from a file, without eval

I play with the writing of data in a file so that it can persist between sessions. I use

f.Write (Data.toSource ());

to save my data, where f is the subject of my file, and

data var = eval (f.read ());

to retrieve the data from the file. But that seems to be a way very unsafe to do things. Of course, it is unlikely that someone will use, preference files AEscript as a door furtively, but it's always just security by obscurity.

Is there a way to read data serialized into a file without using eval()? Or I have to roll-my-own parser / serialize to do safely?

It turns out that this question has an answer here:

Read in JSON · EVAL file and to not NOT fabiantheblind/extendscript Wiki · GitHub

Tags: After Effects

Similar Questions

  • 5 Lightroom sometimes fails to load EXIF GPS data from .jpg files

    Until I Lightroom, I used geoSetter to add GPS data to my .jpg files. Most of them have loaded up in LR without problem, but for some of them, Lightroom could not import the GPS data. I used to compare GPS data in the loaded files OK and those who have not noticed that some of the problem files do not have exiftool: GPS, GPS Time Stamp, dater GPS map data. I used exiftool to change these in the file, Lightroom still not managed to load GPS data.  Anyone has an idea why Lightroom 5 sometimes fails to load EXIF GPS data from .jpg file

    = P3207532.jpg - data from GPS not imported into Lightroom

    ID of the GPS Version 2.2.0.0

    GPS Latitude Ref North

    GPS Longitude Ref is

    REF Altitude GPS altitude

    Time GPS 2015:03:20 02:18:36Z

    GPS Latitude 20 deg 54' 41.68 '' N

    GPS Longitude 107 deg 0' 5.47 "E

    GPS Position 20 deg 54' 41.68 '' N, 107 deg 0' 5.47 "E

    = P3207533. JPG - Imported data GPS OK in Lightroom

    ID of the GPS Version 2.2.0.0

    GPS timestamp 02:22:26

    GPS map Datum WGS-84

    GPS Date Stamp 2015:03:20

    Time GPS 2015:03:20 02:22:26Z

    GPS Latitude 20 deg 54' 43,41 "N

    GPS Latitude Ref North

    GPS Longitude 107 deg 1 9.10 ' E

    GPS Longitude Ref is

    GPS Position 20 deg 54' 43,41 "N, 107 deg 1 9.10 ' E

    = P3207532.edited.jpg - data from GPS not imported into Lightroom

    ID of the GPS Version 2.2.0.0

    GPS Latitude Ref North

    GPS Longitude Ref is

    REF Altitude GPS altitude

    GPS timestamp 02:22:26

    GPS map Datum WGS-84

    GPS Date Stamp 2015:03:20

    Time GPS 2015:03:20 02:22:26Z

    GPS Latitude 20 deg 54' 41.68 '' N

    GPS Longitude 107 deg 0' 5.47 "E

    GPS Position 20 deg 54' 41.68 '' N, 107 deg 0' 5.47 "E

    The problem with P3207532.jpg is that it contains two sets of GPS, a values in the section of EXIF metadata in the XMP metadata section:

    $ exiftool -a -G P3207532.jpg | grep -i gps
    [EXIF]          GPS Version ID                  : 2.2.0.0
    [EXIF]          GPS Latitude Ref                : North
    [EXIF]          GPS Latitude                    : 20 deg 54' 41.68"
    [EXIF]          GPS Longitude Ref              : East
    [EXIF]          GPS Longitude                  : 107 deg 0' 5.47"
    [EXIF]          GPS Altitude Ref                : Above Sea Level
    [EXIF]          GPS Time Stamp                  : 02:22:26
    [EXIF]          GPS Map Datum                  : WGS-84
    [EXIF]          GPS Date Stamp                  : 2015:03:20
    [XMP]          GPS Date/Time                  : 2015:03:20 02:18:36Z
    [XMP]          GPS Version ID                  : 2.2.0.0
    

    But the XMP section contains an incomplete set GPS fields. Note that XMP:GPSDateTime specifies a time other than EXIF:GPSTimeStamp.

    I don't know which of your programs may have created these XMP values false, incomplete, but they confused LR.  According to the specifications of the Working Group of the metadata, which accepted LR, LR, choose the EXIF GPS values and false XMP values should not confuse it. But LR is preferring the XMP values and then conclude it is not all the GPS coordinates.

    You can work around this bug in LR by doing:

    ExifTool - xmp: gpsdatetime = - xmp: gpsversionid = file

  • Import data from txt file and name the channels

    Hello

    I want to import data from a file txt (see attachment). Well well, no proplem, but I want to also read the information on the channel names and units and rename the imported channels. Is it possible to do? It is also important that the number of channels may vary.

    Can someone give me some examples of code?

    Thank you very much

    Gabriel

    Hello Andreas,

    Thanks for your work. I'll adjust the code.

    Gabriel

  • Import data from CSV file

    Dear friends,

    I have already created the directory DIR1.

    I get the following warning message

    1 CREATE OR REPLACE PROCEDURE P2
    2 is
    3 BEGIN
    4. create table (ext_table_csv1)
    5 I have the number,
    Varchar2 (20) n 6,.
    7 m Varchar2 (20)
    4%
    9 organization external)
    type oracle_loader 10
    By default 11 Dir1 directory
    (settings) 12 access
    13 records delimited by newline
    14 fields completed by «,»
    15 field missing values are null
    16)
    17 location ("file.csv")
    18)
    19 reject limit unlimited;
    20 * END P2;
    QL > /.

    CAUTION: Procedure created with compilation errors.

    QL > show err
    rreurs for PROCEDURE P2:

    ERROR OF INE / COL
    ------- -----------------------------------------------------------------
    / 1 PLS-00103: encountered the symbol "CREATE" when expecting one of
    What follows:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while < ID >
    < between double quote delimited identifiers of > < a variable binding > < <
    Close current delete fetch locking insert open rollback
    SAVEPOINT SQLExecute set pipe fusion commit forall

    Please help me.

    NGK246 wrote:
    If at all, I want to recover data from another file CSV (say 'test20101214.txt') to the external table defined so I just need to
    change the location of the CSV pointing to the table, as shown below...
    run immediately "change the location of the table ext_test (" test ' |) " to_char(sysdate-1,'YYYYMMDD') |'. txt ")';
    And then use INSERT... SELECT to inject data into my actual table residing on my database.

    Please correct me if I'm wrong.

    Yes, that's about all.

  • Acquire data from a file using a dialog popup on a stamp object tabs-delimited

    I'm trying to import data from a file delimited by tabs using a dialog popup on a stamp object.  I bought the book by Thom Parker -all on the stamps of the PDF in Acrobat and paperless workflow and have worked through the examples in the Appendix.

    My problem is to understand how to integrate the data in the object of the file dialog box.

    I'm not plagiarizing his book - so am elect at this time is not to justify my code.  The script reads the file, by simply providing only not in the accounts rendered file so that I can choose which line to import into the stamp.

    I typed in the code exactly how the book described, but when the popup dialog object is selected, there is nothing in the menu dropdown.  When I click OK, the first record is placed on the stamp - except for the fields that I am eager to appear in the popup box object dialog box.

    I searched the forums, as well as the JavaScript reference.  There are examples of popup dialog object, but none of them show how to import data from a file - just for the items to be of type in the list.

    Any help would be greatly appreciated!  I tried to work on this for several months now.

    I got the files directly from tdjohnson7700. Here are my findings:

    There are two problems with your files:

    You reference an object of 'Dialogue', even if you declared as 'dialogue' - JavaScript is case-sensitive, so you must use the lowercase version.

    And then you have an additional column of data in your text file, Acrobat doesn't like it and reports an error. You can see when you use the tools > forms > Forms Options more > function to import data to import data from your text file. You must either add a form field named "last" to your stamp, or you need to remove this column from the text file. After these two changes, the stamp works.

  • Download data from text file for Hyperion ESSBASE by FDM.

    Hello

    I want to upload data from text file for Hyperion ESSBASE by FDM. The file format is given below.


    Entity, Department, designation, effective, SalaryPaid
    E11001, BSG, AsstManager, 12, 820000
    E11001, BSG, Manager, 6, 740000


    Where staff and SalaryPaid is the Member of the account dimension. Entity, Department, and designations are the dimensiosn in the ESSBASE.

    Is it possible to download the file above using FDM, can we have two account member in the line?

    I am brand new with FDM. ask for your help.

    Kind regards
    Sunil

    Create two scripts to import (choose Import Data Pump when you are prompted for the type of import script)

    (1) call the GetAccounts 1st and 2nd PutAccounts
    (2) associate GetAccounts size amount in your import format.
    (3) associate PutAccounts with the account dimension in your import format
    (4) adding NZP expression to dimension of amount
    (5) in GetAccounts put the following code...
    +' Get the names of account in the header line.
    If DW. Utilities.fParseString (strRecord, 5, 4, ",") = "number of head" Then
    + ' Local variables for the account names.
    + Acct1 dim +.
    + Acct2 dim +.
    +     +
    + ' Head Count (column 4 of 5) +.
    + Acct1 = DW. Utilities.fParseString (strRecord, 4, 5, ",") +.
    + ' Wages (column 5 of 5) +.
    + Acct2 = DW. Utilities.fParseString(strRecord, 5, 5, ",") +.
    +     +
    End If

    GetAccounts strField =

    (6) in PutAccounts put the following code...

    +'+ Local Variables
    Dim AcctName (2)
    Dim AmountVal (2)
    Dim z
    Dim rsAppend

    + "The names of individual account is analyzed and stored +"
    AcctName (1) = DW. Utilities.fParseString (RES. PvarTemp1, 2, 1, ',')
    AcctName (2) = DW. Utilities.fParseString (RES. PvarTemp1, 2, 2, ',')

    +' If student for accounts from here import file.
    AmountVal (1) = DW. Utilities.fParseString (strRecord, 5, 4, ",")
    AmountVal (2) = DW. Utilities.fParseString (strRecord, 5, 5, ",")

    +' Name of temporary importation work table +.
    strWorkTableName = RES. PstrWorkTable

    +' Create temporary table recordset trial balance +.
    Set rsAppend = DW. DataAccess.farsTable (strWorkTableName)

    For z = 01:58 ' this can change depending on the number of additional accounts processing

    + If IsNumeric (AmountVal (z)) Then +.
    +          +
    + If (z) AmountVal <> 0 Then +.
    +          +
    + ' Create a new record and to provide its field values.
    + rsAppend.AddNew +
    + rsAppend.Fields ("DataView") = "CDA" +.
    + rsAppend.Fields ("PartitionKey") = RES. PlngLocKey +.
    + rsAppend.Fields ("CatKey") = RES. PlngCatKey +.
    + rsAppend.Fields ("PeriodKey") = RES. PdtePerKey +.
    + rsAppend.Fields ("CalcAcctType") = 9 +.
    + rsAppend.Fields ("Account") = AcctName (z) +.
    + rsAppend.Fields ("Amount") = AmountVal (z) +.
    + rsAppend.Fields ("Entity") = 'chain of the entity here ' +.
    + rsAppend.Fields ("UD1") = "string C1 here +.
    + rsAppend.Fields ("node2") = "String C2 here +.
    + rsAppend.Fields ("UD3") = "String C3 here +.
    + rsAppend.Fields ("UD4") = "string C4 here +.
    + "Add folder to the collection +"
    + rsAppend.Update +
    +               +
    + End if +.
    +     +
    + End if +.

    Next

    +' Close the recordset.
    rsAppend.close

    If DW. Utilities.fParseString (strRecord, 5, 4, ',') <> '0' then
    + PutAccounts = DW. Utilities.fParseString (RES. PvarTemp1, 2, 1, ',') +.
    On the other
    + RES. PblnSkip = True.
    End If

    You may need to change the aboveto that meet your exact needs, but the basic structure of the scripts should not change too

    Published by: SH on May 25, 2012 10:34

  • How to move data from flat file to the repository of execution

    Hi all

    We have 2 instances

    1. development - we are able to move the data from flat file to target the DB using scenario1.

    The files are in 04 who's ODI installation box


    2. enforcement Repo

    to scenario1 execution repo installed in ODI 07 which is ODI installation box
    but not able to move the data from flat file to target DB.

    We get an error - file not found.

    File is located in the box 04.

    My question is that what is the best process to make scenario1 course migrated to work.

    Appreciate your help.

    I wanted to say that in view of the dev and prod in the Prod repository agent is not a good idea.

    Ideally, in repo Prod, you must have prod 07 agent.

    In Dev Repo, you shouldn't have dev 04 agent

    makes sense

  • Read data from the file into ArrayList

    Hello
    I have a class called product describing the charactristics of products such as the name, id, price etc.. I have the whole set and use the get methods in my class of product. I store the information on my products in an ArrayList. I can write the information on my products in a file.
    so far, but so good...

    I want now to re-read the data from the file and store it in my list of tables again. I know I can use Parsing and read in data in an ArrayList as String, int, double etc. but is anyway to read in from 'Product' (then it would be up to my class of product)?

    Thank you in advance.

    1. are you aware of serialization?
    2. get a name, I love not dealing with numbers.

    DB

  • Extraction of data from two tables without discounting

    Hi friends,

    I have a problem I want to extract data from two tables without discount in the text field when I will enter any value in a text field, then the value of corressponding must come to textfield corressponding.

    for example. There are two table A and B.
    Table A has Colunm

    S_ID number;
    C_ID Varchar2 (30);
    VARCHAR2 (4) s;

    Second table B Colunm name

    S_ID number;
    What varchar (30);
    L_Name varchar (20);

    When I enter in a text field then the c_id 101 s_id, dry, first_name and last_name should come to corressponding text without refresh fields.

    How can I do that.

    Thank you
    Maury

    You can use Ajax and there are tons of good examples out there for this purpose;
    For example [http://apex.oracle.com/pls/otn/f?p=31517:236:1876567353842241]

  • With the help of the socket object to retrieve data from web application without the html files

    I tried to use the socket object to retrieve data from a web application (I just control script version vs version online). So all I want to do is access http://hyle.io/version that returns me the current version of the application (such as a simple string) in order to compare it in my script and then notifies the user accordingly. I have just a few problems using the socket object. I used this code from the Adobe Javascript Tools Guide:


    reply = "";
    conn = new Socket;
    // access Adobe’s home page
    if (conn.open ("www.adobe.com:80")) {
    // send a HTTP GET request
    conn.write ("GET /index.html HTTP/1.0\n\n");
    // and read the server’s reply
    reply = conn.read(999999);
    conn.close();
    }
    

    ... that I then adapted as:

    reply = "";
    conn = new Socket;
    if (conn.open ("hyle.io:80")) {
      conn.write ("GET /version HTTP/1.0\n\n");
      reply = conn.read(999999); 
      conn.close();
    }
    

    And here is what I get:

    HTTP/1.1 400 Bad Request
    Content-Length: 225
    Content-Type: text/html
    Server: Pagodabox-Routing-Mesh
    
    

    Bad Request

    Your browser sent a request that this server could not understand.

    Résultat : true

    I don't know a lot about HTTP requests, but I wondered if it was related to the fact that I am not pointing to a specific HTML file and the type of request was wrong or if I should rather check if there is something wrong with my host?

    The site/app is PHP and is hosted on PagodaBox if it helps.

    Thanks in advance!

    Hi Sebastien Lavoie,

    It should work

    var HTTPFile = function (url, port) {}

    If (arguments.length == 1) {}

    URL = arguments [0];

    port = 80;

    };

    This.url = url;

    This.port = port;

    this.httpPrefix = this.url.match(/http:\/\//);

    This.Domain = this.httpPrefix is nothing? This.URL.Split("/") [0] + ":" + this.port: this .url .split ("/") [2] +":" + this.port;

    This.Call = ' GET ' + (this.httpPrefix == null? ' "). " http://" (+ this.url: this.url) + "HTTP/1.0\r\nHost: ' + (this.httpPrefix is nothing? "This.URL.Split("/ ") [0]: this .url .split (" / ") [2]) +" \r\nConnection: close\r\n\r\n ";

    This.Reply = new String();

    This.Conn = new Socket();

    This.Conn.Encoding = "binary";

    HTTPFile.prototype.getFile = {function (f)}

    var typeMatch = this.url.match(/(\.) (\w{3,4}\b)/g);

    If (this.conn.open (this.domain, "binary")) {}

    This.Conn.Write (this.) Call);

    This.Reply = this.conn.read (9999999999);

    This.Conn.Close ();

    } else {}

    This.Reply = "";

    }

    (Return this.reply.substr(this.reply.indexOf("\r\n\r\n")+4);

    };

    }

    Hyle var = new HTTPFile ("http://hyle.io/version");

    Alert (hyle. GetFile());

    And by the way, I like the idea of 'http://hyle.io'. Can you give me your email address, I want to learn more about this Web site.

    Please send me an email to [email protected]

  • Import data from text file of control of the ring.

    Is it possible to import data to a text ring with labview control.

    I have several definitions of register in the ring controls, but manual entry would take a lot of time.

    Was wondering if there was more automatic way, I could read the values from a file.

    Thank you

    Jim

    Using the first method gives you the ability to extend such that each column specifies a control of the ring if you need fill the multiple rings.

    This example assumes that all of the three rings contain the same number of elements. If this isn't the case, you will need to create a Subvi, which removes the empty elements. [Edit - create a text file that contains a column for each ring, separated by a tab character.]

  • Delete data from database file

    Hi all

    I have an 11.1.0.7 database where I wanted to delete a data file. The database is archivelog.

    The first thing I did was to ensure that no data has been in the data file. -OK
    Then, because I wanted to only remove 1 week later, I put the data offline - OK file
    On the day (a week after putting in offline mode) I was going to delete/move the data of the table space file, I got an ORA-saying to put the online data file, before back down.

    And here is my problem! The database indicates that the data file should recover :(

    Issues related to the:
    1. If the data file was disconnected, why he need to recover?
    2. you do that the database won't ask you all archivelogs until now to recover the datafile?
    3-if I do not want to apply all archivelogs, can I just delete the data file by recreating the controlfile without this data file?

    Thank you.

    cibernauta wrote:
    Tested and as said it asked the archivelogs, but, since the data file has been placed offline 1 month ago I need to apply a large number of archives.

    What alternatives I have to remove this data from the database file? Is it just to get out all the objects in the storage space, drop and then re-create it without the data file?

    Thank you.

    If you are sure that there is nothing in this file? If so, that the workaround mentioned above will work. Otherwise, you would need to put the file online, get the exported objects and that only it would be possible to move the data.

    HTH
    Aman...

  • How to read data from several files and add columns in a single file

    Hi guys,.

    I have a problem in adding data from files in different columns. I have the attachment a file A and B which I am reading and not able to get the data in the Result.txt file. Please give your opinion on how can I do this

    You must add the data of all files before proceeding with a single entry.

  • Tracing of data from CSV file to XY Chart

    Hi all

    I need to read data from a worksheet (*.) CSV) and then to trace in LabVIEW.

    The file contains three values

    Time, Date, temperature value

    For example, here are the Logs.

    16:46:59,31/01/14,+018.2C
    16:47:59,31/01/14,+018.2C
    16:48:59,31/01/14,+018.2C
    16:49:59,31/01/14,+018.2C
    16:50:59,31/01/14,+018.5C
    16:51:59,31/01/14,+018.5C
    16:52:59,31/01/14,+018.5C
    16:53:59,31/01/14,+018.5C
    16:54:59,31/01/14,+018.5C
    16:56:40,31/01/14,+018.5C
    16:57:40,31/01/14,+018.5C

    .

    .

    .

    .

    .

    .

    23:51:24,31/01/14,+015.0C
    23:52:24,31/01/14,+015.0C
    23:53:24,31/01/14,+015.0C
    23:54:24,31/01/14,+015.0C
    23:55:36,31/01/14,+015.0C
    23:56:44,31/01/14,+015.0C
    23:57:44,31/01/14,+014.6C
    23:58:44,31/01/14,+015.0C
    23:59:44,31/01/14,+015.0C

    What I have to do is create a VI in LabVIEW to visualize these data.

    I did it as below:

    It seems correct, but the x axis is the axis of time and 16:46:59 it's just to show 16, I know that I have not done something to handle this.

    But I'm not able to find what I can do in this case.

    Please suggest how to get exact values full time on the x-axis.

    Code of your VI contains a bit of 'orphan' reading of the worksheet"which has wired the file path.  Diagram-disable (or remove) this superfluous code and your VI will work very well with Temp.txt in control of the path of the file.

    Bob Schor

  • read data from xlsx file

    How to read data from an Excel 2010 worksheet with the .xlsx extension?  The data I want, it's on one of the 10 tabs in the file, I have to choose which programmatically.  I have the Report Generation Toolkit for LV2012, but all the screws that come with it seem to focus around writing data to a spreadsheet Excel and make charts and whatnot.  I want to * read * an Excel worksheet.  Seeking answers led to many 'Open it and save it as tab delimited text', which I can't do because I need data from different tabs, and because this file is quite dynamic with many users opening and adding several times.  In order to save the tab I want as a tab delimited text file per programming, I'm back a square, how to open it?

    My solution would ideally fill in the blanks of: spreadsheet.xlsx---> _---> 2 or 3D data table.

    Thank you

    Adam

    This fixes:

    https://decibel.NI.com/content/docs/doc-3033

Maybe you are looking for