Pulling text strings from a file in Quartz Composer

I want to create a screensaver that randomly displays quotes from a specified file. It doesn't matter how the file is formatted -- txt, xls, etc. -- as long as Quartz can randomly display quotes from the file. I know how to display text strings in Quartz, and I know how to randomize graphic functions, but not how to randomize display of text strings.
Any ideas?

Here is a shuffling algorithm:
http://tekpool.wordpress.com/2006/10/06/shuffling-shuffle-a-deck-of-cards-knuth- shuffle/
Basically, pass through the file once to get the number of strings (n), than shuffle an array of integers 1 to n using an algorithm like the above. As each number comes up, pull that string out of the file.

Similar Messages

  • Hello i need a help about script to export translatable text strings from ai files and import them back

    Hello i need a help about script to export translatable text strings from ai files and import them back after editing, thanks in advance

    Lanny -
    Thank you for taking the time to help with this problem. Can I just say however that as someone who has posted a first comment here and quite clearly never used a forum like this before, your comment unfortunately comes across as very excluding. It makes me feel there are a set of unwritten rules that I should know, and that I don't know them shows that the forum is not for me. In short, it's exactly the kind of response that stops people like me using forums like this.
    I'm sure it's not intended to be received like this and I am sure that the way you have responded is quite normal in the rules of a forum like this. However, it is not normal for those of us who aren't familiar with forums and who only encounter them when they have a genuine problem. This is why I hope it is helpful to respond in full.
    The reason I posted here is as follows. I was directed here by the apple support website. The original comment seemed to be the only one I could find which referred to my issue. As there is no obvious guidance on how to post on a forum like this it seemed perfectly reasonable to try and join in a conversation which might solve more than one problem at once.
    Bee's reply however is both helpful and warm. This could in fact be a template for how new members should be welcomed and inducted into the rules of the forum in a friendly and inclusive way. Thank you very much indeed Bee!

  • How to search specific text/string in pdf files from command prompt?

    Hi,
    How to search specific text/string in pdf files from command prompt?
    Will be great if you can refer to any adobe provided command base utility to achieve the above target.
    Best Regards,

    You can't. The commandline parameters for Acrobat and Adobe Reader do not allow any type of commands to be run.

  • Need to get a particular string from a file!!

    Hi-
        In a linux server,i need to pull some data from the logfiles from the dir "
    /dev/bld/autosys/autosys-be/jobs/",under this dir we have so many applications like- ada-2013.06.0,bda-2013.06.0,cda-2013.06.0 etc...
          Which are also directories(
    ada-2013.06.0,bda-2013.06.0,cda-2013.06.0) under this each dir ,we can find a logfile.
          from the logfile we need to pull some data to generate a report.
           Here in the logfile we could find a request name "xyz
    -sib_ada-2013.06.0" after the string "ci-" in every part of logfile,so i would like to pull this information from the logfle after that i would like to issues the command "p4 branch xyz-sib_ada-2013.06.0" to get source and target details.
    if you issue the above command it looks like...
    Branch:xyz-sib_ada-2013.06.0
    Update: 2013/05/13 12:25:28
    Access: 2013/05/31 13:48:56
    user : xxx
    Description:
            Created by xxxx
    status :        unlocked
    View:
            //xyz-sib/fb-download-app/ada-server/mda-2013.05.0/... //xyz-sib/fb-download-app/ada-server/mda-2013.06.0/...
    here i would like to pull the string as source thing as    //xyz-sib/fb-download-app/ada-server/mda-2013.05.0/
    target    -
    //xyz-sib/fb-download-app/ada-server/mda-2013.06.0/...

    Hi,
    Its very hared to understand what you want, if i understand correctly  you want to find some set of string from the files  in a diretory
    if yes you can do something like this
    cd /dev/bld/autosys/autosys-be/jobs/
    find . -type f -exec grep "<string you want to serch>" {} \; -print
    It will list the file having some set of string you are serching..
    HTH

  • Remove string from txt file

    Hello guys,
    I need some help. I have to remove some content of Tolerance "column" (see attach). The string which I wish to remove is "+/- 0s" and replace it with an empty string. I need to remove this for each row where "+/- 0s" appears.  
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    sample.txt ‏3 KB

    Hi Samoth,
    I dont know if I understood your requirement properly, but please check the attached snippet if it helps.
    If this does not satisfy your requirement, then please give some more details.
    Attachments:
    Remove string from txt file.png ‏21 KB

  • How load text into dynamic text boxes from external file?

    hi all,
    my animation is very simple - a background image and 2 text boxes.  one of the textboxes shows a large word, which crossfades to another word, with a total of about 12 words (showing one at a time in different text boxes fading in & out in the same spot).
    i need a way to have the text be imported dynamically via xml or json (xml preferred).  this article is a good start, but i noticed he's putting all of the text into one box - i need separate strings put into separate boxes from the xml.
    Chris Gannon - Loading XML via AJAX into Adobe Edge
    he uses
    var outputField = $(this.lookupSelector(“xmlOutput”));
    for his text box.  what would be the best way to revise this code to include all my individual strings to be loaded into my individual text boxes?  thinking an array might work, but my js skills are limited.
    any other suggestions or tutorials you could point me to would be appreciated.
    thanks!!

    thanks joel_pau !
    this is helpful in seeing how the array is created, but after giving it a go I became a little confused.
    i wound up trying it again based on the example i linked out to previously, but it's not adding the text from my xml file when previewing.
    here's the code i'm using in edge animate on my stage.  something must be wrong somewhere.  let me know if you have any suggestions on this.
    // insert code to be run when the composition is fully loaded here
    // here i'm assigning a variable to each one of my textboxes at they're named in my edge animate comp
    var outputField1 = $(this.lookupSelector("helps2"));
    var outputField2 = $(this.lookupSelector("communicate"));
    var outputField3 = $(this.lookupSelector("experience"));
    var outputField4 = $(this.lookupSelector("interact"));
    var outputField5 = $(this.lookupSelector("understand"));
    var outputField6 = $(this.lookupSelector("overcome"));
    var outputField7 = $(this.lookupSelector("flourish"));
    var outputField8 = $(this.lookupSelector("collab"));
    var outputField9 = $(this.lookupSelector("trust"));
    var outputField10 = $(this.lookupSelector("grow"));
    var outputField11 = $(this.lookupSelector("engage"));
    var outputField12 = $(this.lookupSelector("survive"));
    var outputField13 = $(this.lookupSelector("thrive"));
    var outputField14 = $(this.lookupSelector("evolve"));
    var outputField15 = $(this.lookupSelector("connect"));
    var outputField16 = $(this.lookupSelector("achieve"));
    $.ajax({   
        type: "GET",
        url: "myxmlfile.xml",
        dataType: "xml",
        success: function(xml) {
    //here i'm trying to load the the text in my xml file into my textboxes in edge animate.  'txt1, txt2, txt3' are the tags in my xml file
            outputField1 = $(xml).find('txt1').text();
            outputField2 = $(xml).find('txt2').text();
            outputField3 = $(xml).find('txt3').text();
            outputField4 = $(xml).find('txt4').text();
            outputField5 = $(xml).find('txt5').text();
            outputField6 = $(xml).find('txt6').text();
            outputField7 = $(xml).find('txt7').text();
            outputField8 = $(xml).find('txt8').text();
            outputField9 = $(xml).find('txt9').text();
            outputField10 = $(xml).find('txt10').text();
            outputField11 = $(xml).find('txt11').text();
            outputField12 = $(xml).find('txt12').text();
            outputField13 = $(xml).find('txt13').text();
            outputField14 = $(xml).find('txt14').text();
            outputField15 = $(xml).find('txt15').text();
            outputField16 = $(xml).find('txt16').text();
    but nothing happens on preview.  my textboxes still contain the original text that lives in my comp.

  • Problem with reading String from Xlsx file.

    Hi! I am trying to read string and numerical data from an xlsx file and trying to display its contents in a word file. I tried converting it to a .lvm file too. On using the "Read From Spreadsheet" tool, I get random characters as output. On using " Read From Measurement File" tool, I am getting an error saying "Error 100 occurred at Read From Measurement File->Untitled 1". What do I do? At the end I need to display the output, row by row, in a Microsoft Word file. I am so lost. Please Help.
    Solved!
    Go to Solution.

    bsvare wrote:
    labview currently does not read directly from an xlsx file. If you convert the xlsx to an xls file first, then you can use the read from spreadsheet tool to load the data from the file.
    Hey, I tried doing that. It still just gave the values 0.00 in all the cells of the indicator array. Plus my file has string in it also. The data type in the spreadsheet was "general". Here in the tool, it is "Double". I changed the tool data type to string and spreadsheet to text but I only got gibbrish for my efforts.
    Thanks anyway!

  • Extracting string from a file name

    Hello,
    I have a legacy (read: I didn't build it) SharePoint list  that includes some validation when uploading files that's giving me some trouble.
    Basically, our users are required to add files to a list in a certain filename format and based on the naming convention are approved/rejected and routed to the appropriate location.
    One of the validations looks at a section of the file name and compares it to a folder name in the library.
    For example, the file name format is XX_AAA_999_2014_05.xlsx and that matches on the folder name of /submissions/2014_05
    Currently the rule says look at the last 7 characters of the folder and the 7 characters starting at position 12 of the filename and make sure they match.
    The problem is the 999 in the example above is a sequential identifier to the project a file is associated with... e.g. they range from project 000 to project 999. We've now hit project 1000 so file being added for project 1000 (and beyond) fails because
    the starting position has shifted one spot. (Note: we have active 3 digit projects so I cannot simply change that to be position 13... not to mention what that does to my history).
    So, my task is to come up with something that can accomodate 3 or 4 digit numbers.
    I'm trying to stick as closely to the original setup so I don't mess up the history so I'm looking at other methods of getting to the same data in the string.  Another problem is that the file names include the extension and the extension can be 3 (pdf)
    or 4 (xlsx) characters long.
    I've tried this:  =LEFT([Source File Name],SEARCH(".",[Source File Name])-1)
    but that brings back everything in front of the period and I need just the 7 preceeding characters.  Is there a way to limit the number of chars a LEFT() function returns?
    In a nutshell, the 4 variations of file names are as follows of which I need to extract the
    bolded section.:
    ZZ_AAA_999_2014_05.xls
    ZZ_AAA_999_2014_05.xlsx
    ZZ_AAA_1000_2014_05.xls
    ZZ_AAA_1000_2014_05.xlsx
    Thanks!
    Kevin

    Hi,
    According to your description, you might want to retrieve the string “2014_05” from the file name.
    I would suggest you create a SharePoint Designer workflow and implement your logic of handling the filename.
    In SharePoint Designer 2010, there are already some useful utility workflow actions which can enable users to deal with the various requirements come from the business scenarios.
    For the string handling, you can consider to use the
    Utility Actions:
    http://msdn.microsoft.com/en-us/library/office/jj164026(v=office.15).aspx
    Another two links about creating SharePoint Designer workflow for your reference:
    http://office.microsoft.com/en-001/sharepoint-designer-help/introduction-to-designing-and-customizing-workflows-HA101859249.aspx
    http://www.codeproject.com/Tips/415107/Create-a-Workflow-using-SharePoint-Designer
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • Using a calculated column to pull a string from another column

    Ok let me try to explain my situation. I have a column with multiple paragraphs or text. I want a calculated column to only pull the top paragraph. This break between paragraphs would be an <Enter>. Nothing else. Is there a way to signal pull this
    string but break at the <enter>.
    I don't think it is. But thought I'd ask.

    Yes, you can do this. But you need to use the CEWP and jQuery. Refer to the following post for more information
    https://www.nothingbutsharepoint.com/sites/eusp/pages/taming-the-elusive-_e2_80_9ccalculated-column_e2_80_9d-referencing-multiple-lines-of-text-column.aspx
    http://stackoverflow.com/questions/10486939/jquery-show-only-first-paragraph-of-each-article
    --Cheers

  • Copying TEXT column from flat file into SQL results in empty fields....

    I'm copying TEXT column from SQL to Flat file (ragged right fixed width) - DT_TEXT. It copies fine and I''ve checked the output file. Now, while trying to copy the flat file to sql server in another system. I find all the fields are empty.
    When I preview the source from flatfile, I see all the entries there. But it copies other fields but the field with DT_TEXT  is empty.
    This is when I preview
    SQL Table output
    Any help will be helpful!!!

    Hi, I'm not sure If I'm understanding what you're saying. The data got copied from SQL to Flat file. I've double checked the flat file and I see the DT_TEXT data there. The size of file also gives an indication that there's existence of TEXT Data
    But, when I copy that data back to sql again (which I can also preview before the load), The DT_TEXT values goes missing. Same when I copy to Excel as CSV or as a Flat file. I don't see text data.
    The TEXT data resides on the first output. But when I try to extract to other format from that output, it doesn't come out.

  • To read string from another file

    Dear friends
    I am working on a project where i need to read log files which are there on my C drive.
    I got a folder and from that i need to read string from another folder and name them as URL,TS etc..so any body have any idea about this...

    I have no idea what you're even trying to do. Can you try explaining your problem more clearly and in more detail?

  • How to append a string from a file to a string???????????

    hi there
    the following code reads a line from a file,
    while (true)
    try
    line = br.readLine();
    catch (IOException e)
    System.out.println("Error reading data file");
    System.exit(1);
    if (line == null) break;
    st = new StringTokenizer(line, delimiterString);
    n = st.countTokens();
    if (first == 0) first = n;
    if (n != first)
    System.out.println("Data format error!");
    System.exit(1);
    how will i append the line to itself each time the loop runs? the line should contain all the lines in the file, not just a single line. thank you

    You can make a StringBuffer object with the same scope as the line String and keep appending to the StringBuffer. You can use StringBuffer's toString() method to get a String back when you need it. You can also do this with a String instead of a StringBuffer using +=, but the String buffer is a lot more efficient.
    StringBuffer wholeFile = new StringBuffer();
    while (true)
    try
    line = br.readLine();
    wholeFile.append(line);  // or put this wherever it makes most sense
    catch (IOException e)
    System.out.println("Error reading data file");
    System.exit(1);
    if (line == null) break;
    st = new StringTokenizer(line, delimiterString);
    n = st.countTokens();
    if (first == 0) first = n;
    if (n != first)
    System.out.println("Data format error!");
    System.exit(1);
    }

  • Reading A String From A File

    Having Difficulties Parsing a file for specific information. How do you either convert a int (from the read class) to a stream or how do you read a stream directly from a file?
    Also need to know how can ensure that tags within an XML document do not overlap...
    any help is appreciated -- thank you...
    import java.io.*;
         public class Check
         public static void main(String[] args) throws IOException
              if (args.length != 1)
                   System.out.println("JAVA Check <doc.xml>");
                   return;
              String fileName;
              fileName = args[0];
              if (fileName.endsWith(".xml"))
                   System.out.println("THE FILE IS A VALID XML FILE");
                   else
                   System.out.println("NOT A VALID XML FILE");
              File inFile=new File(args[0]);
              FileReader fr=new FileReader(inFile);
              File outFile=new File(args[0]);
              FileWriter fw=new FileWriter(outFile);
              String frontopentag = "<";
                   Check fot=new Check();
                   int countfrontopentag = 0;
              String frontclosetag = "</";
                   Check fct=new Check();
                   int countfrontclosetag = 0;
              String backclosetag = ">";
                   Check bct=new Check();
                   int countbackclosetag = 0;
              int c=0;
              c=fr.read();
              while (c != -1)
                   fw.write(c);
                   c=fr.read();
                        if (fot.equals("<"))
                        ++countfrontopentag;
                        return;
                        if (fct.equals("</"))
                        ++countfrontclosetag;
                        return;
                        if (bct.equals(">"))
                        ++countbackclosetag;
                        return;
                        if (countfrontopentag != countfrontclosetag)
                        System.out.println("CHECK THAT THE OPENING OF THE TAGS ARE BALANCED, '<...' AND '</...'");
                        else
                        System.out.println("OPENING TAGS ARE BALANCED, '<...' AND '</...'");
                        if(countbackclosetag%2 == 0)
                        System.out.println("CLOSING TAGS ARE BALANCED, '...>'");
                        else
                        System.out.println("CHECK THAT THE CLOSING TAGS ARE BALANCED, '...>'");
                        if((2*countbackclosetag) != countfrontopentag)
                        System.out.println("CHECK THAT THE NUMBER OF '<...' AND '</...' EQUALS THE NUMBER OF CLOSING TAGS, '...>'");
                        else
                        System.out.println("THE NUMBER OF '<...' AND '</...' EQUALS THE NUMBER OF CLOSING TAGS, '...>'");
              fr.close();
              fw.close();
              } //close main
         } //close class

    Well... I have no idea of how much java you know, so please forgive me if I state something you already know by heart.
    your best bet for the integer is reading by characters,
    testing them, (Character.isDigit(a valid character)) and the Character.digit(char ch, int radix) method.
    char ch;
    forloop
    ch = aString.charAt(i);
    if (Character.isDigit(ch))
    while your best bet for overlapping brackets and such would be to use a number, and add to it whenever there is a left-hand bracket, and subtract from it, whenever there is a right-hand bracket. or use a stack to save the characters within the brackets and then, whenever you find a right-hand bracket, evaluate the string up to the point of the last left-hand bracket.

  • Loading Knob Digital Display Text Labels from External File

    I have a knob interface. I display it on the instrument's front panel with the digital display.
    The knob controls the settings on an external GPIB switch. The value of the 6 devices selected changes. I want to see the numbers 1 thru 6 on the knob, but the knob's digital display needs to show something like "12.5-13.5 MHz BPF".
    I want to load the text visible in the knob's digital display from an external file located on the machine. I will not have the possibility of changing the VI for each location.
    Can you do that?
    If not, would an a case or event structure containing a text indicator, with text values read in from a file, be the best apporach?
    73/gus

    If you don't have 8.0 and XControls, you can do something like the attached. I edited the knob control and then replaced the digital display with a text ring.Message Edited by Dennis Knutson on 04-21-2006 12:32 PM
    Attachments:
    Knob with text ring.vi ‏30 KB

  • Pass rich text string from webdynpro java into interactive form

    Hi, experts:
      I know rich text-related questions have been asked by many other forum member.
      But I still cannot figure out how to display rich text string in the interactive form.
      below code is set rich text string in my webdynpro program.
    wdContext.currentDataForPDFElement().setDescription("<html xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\" xfa:contentType=\"text/html\"><body><p>20100730 0950</p><h1><strong>test1</strong><br /></h1></body></html>");
    or
    wdContext.currentDataForPDFElement().setDescription("<p>20100730 0950</p><h1><strong>test1</strong><br /></h1>");
    Text field in the interactive form has been assign "Field Format" to "Rich Text", "Data Format" to "XHTML".
    I also check XML in the "XML source" tab of interactive form.
    <field name="Description" w="152.817mm" minH="25.2984mm" colSpan="3" access="readOnly">
      <ui>
      </ui>
      <font typeface="Myriad Pro"/>
      <bind match="dataRef" ref="$record.Description"/>
      <value>
         <exData contentType="text/html">
            <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="2.4.5277.0"/>
         </exData>
      </value>
    </field>
    My development tool version is NWDS CE EHP1 SP4, LiveDesigner v 7.1.
    What I miss? Any hints would be very appreciated.

    What about these:
    Formatting in SO10 texts into the form
    Trouble with xhtml text in adobe forms
    Prevent HTML escaping in RichText fields
    regards Otto

Maybe you are looking for

  • IPod Touch (2nd gen) not recognized by computer and iTunes

    When I connect my iPod Touch to my laptop, running Windows 7, neither the computer nor iTunes recognizes my iPod. Everything worked before with Vista. When I plug the iPod into the computer the iPod does turn on put the battery doesn't charge and the

  • Epson printing issue

    This is probably totally unrelated to my new I-mac, but I had to post this question because it is very strange. I just purchased a new dual core intel I-mac and loaded the epson driver for my 14 month old Epson R800. After printing about 4 photo's fr

  • HT1296 How to upload the ringtone (transfer) from my normal computer to Iphone4. plz help me

    How to upload the ringtone (transfer) from my normal computer to Iphone4. plz help me

  • WebService and ActionScript class

    Hi, I am trying to create an actionscript class to use it in my mxml component. I have the floowing code which works perfectly. <?xml version="1.0" encoding="utf-8"?> <mx:Application creationComplete="HTTPdecision.send()" xmlns:mx=" http://www.adobe.

  • PHP 5.1.2,,,OCI8,,,ORA-12546

    Hi there, Thanks to Christopher Jones and his very well document " Installing PHP and the Oracle 10g Instant Client for Linux and Windows " http://www.oracle.com/technology/pub/notes/technote_php_instant.html I followed the steps mentioned in that ar