Find Change through external text file

Hello folks
I am bit pretty in InDesign scripting so could you please look into this.
How can i change any particular text field in Indesign CS3 document from text file.
I do have find change script but for each InDesign document specific text file is assigned.
So each time i have to modify find change GREP property that is also repetetive of work. Is there any way to get find change information should be extract from external text file.
Many Tanks in advance

In the FindChangeByList script, you could customize the function myFindFile(myFilePath) {...} as to search the FindChangeList text file in the document location rather than the script location. That's an example. The question is: given a document, where will you have the corresponding FindChangeList?
@+
Marc

Similar Messages

  • Automator - Loop through a text file and process data through a 3rd party software

    Just stumbled on Automator the other day (I am a mac n00b) and would like to automate the processing of a text file, line-by-line, using a third party tool.  I would like Automator to loop through the text file one line at a time, copy the string and keep as a variable.  Next, place the variable data (copied string) into the text field of the 3rd party software for processing.  Once the processing is complete, I would like Automator to fetch the next line/string for processing.  I see items like "copy from clipboard" and  "variables" within the menu but I am not finding much documentation on how to utilizle this tool.  Just hear how potentially powerful it is. 
    The 3rd party software is not a brand name, just something made for me to process text.  I may have to use mouse clicks or tabs + [return] to navigate with Automator.  A term I heard on Bn Walldie's itunes video series was "scriptable software" for which I don't think this 3rd party app would be. 
    Kind regards,
    jw

    Good news and bad news...
    The good news is that it should be entirely possible to automate your workflow.
    The bad news is that it will be a nightmare to implement via Automator, if it's even possible.
    Automator is, essentially a pretty interface on top of AppleScript/Apple Events, and with the pretty interface comes a certain stranglehold on features. Knowing how to boil rice might make you a cook, but understanding flavor profiles and ingredient combinations can make you a chef, and it's the same with AppleScript and Automator. Automator's good at getting you from points A to B but if there are any bumps in the road (e.g. the application you're using isn't scriptable) then it falls apart.
    What I'm getting at is that your requirements are pretty simple to implement in AppleScript because you can get 'under the hood' and do exactly what you want, as opposed to Automator's restricted interface.
    The tricky part is that if no one else can see this app it's going to be hard to tell you what to do.
    I can give you the basics on reading a file and iterating through the lines of text in it, and I can show you how to 'type' text in any given application, but it may be up to you to put the pieces together.
    Here's one way of reading a file and working through each line of text:
    -- ask the user for a file:
    set theFile to (choose file)
    -- read the file contents:
    set theFileContents to (read file theFile)
    -- break out the lines/paragraphs of text:
    set theLines to paragraphs of theFileContents
    -- now iterate through those lines, one by one:
    repeat with eachLine in theLines
      -- code to perform for eachLine goes here
    end repeat
    Once you have a line of text (eachLine in the above example) you can 'type' that into another application via something like:
    tell application "AppName" to activate
    tell application "System Events"
              tell process "AppName"
      keystroke eachLine
              end tell
    end tell
    Here the AppleScript is activating the application and using System Events to emulate typing the contents of the eachLine variable into the process. Put this inside your repeat loop and you're almost there.

  • Find exact word in text file tht is present in an excel sheet

    Hi all,
    i want to find words in an text file.
    but the criteria is i want to search words which r already listed in another excel sheet and change the color of these word.
    i used FileInputStream
    and also BufferedInputStream
    cany anyone help me with this

    hi kajbj,
    can u plz tell me how to do in VBA then
    will find out the way to do in java
    Thanx

  • How to load external text file into a Form?

    Hi,
    I made a menu with 1-5 in a Form and 5 external text files. I want the user who is able to view the text content of the text file when he chooses one of them from the menu. And the text file screen has a "Back" command button to let him go back.
    How can I do it and can it support other languages such as Chinese and Japanese?
    Thanks for help.
    gogo

    Sorry, I made the mistake about the subject, it should be loading local file, not external file through http.
    I wrote a method but it throwed an exception when the midlet was run.
    private void loadText()
    try {
    InputStream is = this.getClass().getResourceAsStream("/text.txt");
    StringBuffer sb = new StringBuffer();
    int chr;
    while ((chr = is.read()) != -1)
    sb.append((char) chr);
    is.close();
    catch (Exception e)
    System.out.println("Error occurs while reading file");
    I put the text.txt file in the same folder with the main file (extends midlet). How can I load the text content and display it on StringItem?
    Thanks for any help.
    gogo

  • Reading through a text file and then sorting

    I'm having a lot of problems with this.
    I have to read through a text file and I have to split the string up so that it is seperated into individual tokens. A line from the text file looks like this. addEvent(new Bell(tm + 9000)). I have to grab the addEvent, new, Bell, tm and 9000 and store it in a linkedlist. After reading through the whole text file I have to sort the the linked list based on the number. ie: 9000. Is there any way to do this? I currently break up the text file using a StringTokenizer object but then i am uncertain on how to add it to a linked list and then sort each line based on the number. Any help would be appreciated.
    Joe

    Sorry to bother you Ben but I just can't get my head wrapped around this. Here is exactly what I have to do:
    After reading, Events must be stored in the EventSet according to the time they are to occur. Assume that no time number is more than 8 digits long. Restart() must be able to deal appropriately with any order of the Events. To accomplish this have Restart() save the relevant Event information in an LinkedList of strings and sort the Events by time before adding each event to EventSet. Use the <list>.add() to set up your linked list. This is shown in c09:List1.java and Collections.sort(<list>) shown in c09:ListSortSearch. Modify the Bell() to output a single "Bing!". When you read in a Bell event generate the appropriate number of Bell events as indicated by rings. These must be set to the correct times. This is an alternative to generating the new Bell events within Bell(). It will allow them be sorted into their correct time sequence. At this point the output of the program should be identical the original program.
    After the intitial start, when restarting Restart() must provide to the user the option to recreate the EventSet from the linked list or read in a new file (supplied by the user). This must be achieved by prompting the user at the console. Please also allow the user the option to quit the program at this stage.
    Main Program Code:
    public class GreenhouseControls extends Controller
    private boolean light = false;
    private boolean water = false;
    private String thermostat = "Day";
    private boolean fans = false;
         private class FansOn extends Event
              public FansOn(long eventTime)
                   super(eventTime);
              public void action()
              // Put hardware control code here to
              // physically turn on the Fans.
              fans = true;
              public String description()
                   return "Fan is On";
         private class FansOff extends Event
              public FansOff(long eventTime)
                   super(eventTime);
              public void action()
              // Put hardware control code here to
              // physically turn off the Fans.
              fans = false;
              public String description()
                   return "Fans are Off";
         private class LightOn extends Event
              public LightOn(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here to
                   // physically turn on the light.
                   light = true;
              public String description()
                   return "Light is on";
         private class LightOff extends Event
              public LightOff(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here to
                   // physically turn off the light.
                   light = false;
              public String description()
                   return "Light is off";
         private class WaterOn extends Event
              public WaterOn(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here
                   water = true;
              public String description()
                   return "Greenhouse water is on";
         private class WaterOff extends Event
              public WaterOff(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here
                   water = false;
              public String description()
                   return "Greenhouse water is off";
         private class ThermostatNight extends Event
              public ThermostatNight(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here
                   thermostat = "Night";
              public String description()
                   return "Thermostat on night setting";
         private class ThermostatDay extends Event
              public ThermostatDay(long eventTime)
                   super(eventTime);
              public void action()
                   // Put hardware control code here
                   thermostat = "Day";
              public String description()
                   return "Thermostat on day setting";
         // An example of an action() that inserts a
         // new one of itself into the event list:
         private int rings;
         private class Bell extends Event
              public Bell(long eventTime)
                   super(eventTime);
              public void action()
                   // Ring every 2 seconds, 'rings' times:
                   System.out.println("Bing!");
                   if(--rings > 0)
              addEvent(new Bell(System.currentTimeMillis() + 2000));
              public String description()
                   return "Ring bell";
         private class Restart extends Event
              public Restart(long eventTime)
                   super(eventTime);
              public void action()      
                   long tm = System.currentTimeMillis();
                   // Instead of hard-wiring, you could parse
                   // configuration information from a text
                   // file here:
              try
              BufferedReader in = new BufferedReader(new FileReader("Event Config.txt"));
              String str;
                   String[] l1 = new String[5];
                   LinkedList l2 = new LinkedList();
              while((str = in.readLine()) != null )
                        StringTokenizer st = new StringTokenizer(str, "(+); ");
                        int nIndex = 0;
                        while (st.hasMoreTokens())
                             l1[nIndex] = st.nextToken();
                        //System.out.println(st.nextToken());
                             nIndex++;
                        l2.add(l1);
                   String[] s1 = (String[])l2.get(1);
                   for(int i = 0; i < s1.length; i++)
                        System.out.println(s1);
                   Comparator comp = s1[4];
                   Collections.sort(l2, comp);
              in.close();
              catch (IOException e)
    rings = 5;
    addEvent(new ThermostatNight(tm));
    addEvent(new LightOn(tm + 1000));
    addEvent(new LightOff(tm + 2000));
    addEvent(new WaterOn(tm + 3000));
    addEvent(new WaterOff(tm + 8000));
    addEvent(new Bell(tm + 9000));
    addEvent(new ThermostatDay(tm + 10000));
    // Can even add a Restart object!
    addEvent(new Restart(tm + 20000));*/
    public String description() {
    return "Restarting system";
    public static void main(String[] args) {
    GreenhouseControls gc =
    new GreenhouseControls();
    long tm = System.currentTimeMillis();
    gc.addEvent(gc.new Restart(tm));
    gc.run();
    } ///:~
    Examples File:
    addEvent(new ThermostatNight(tm));
    addEvent(new Bell(tm + 9000));
    addEvent(new Restart(tm + 20000));
    addEvent(new LightOn(tm + 1000));
    addEvent(new WaterOn(tm + 3000));
    rings = 5;
    addEvent(new FansOn(tm + 4000));
    addEvent(new LightOff(tm + 2000));
    addEvent(new FansOff(tm + 6000));
    addEvent(new WaterOff(tm + 8000));
    addEvent(new WindowMalfunction(tm + 15000));
    addEvent(new ThermostatDay(tm + 10000));
    EventSet.java Code:
    // This is just a way to hold Event objects.
    class EventSet {
    private Event[] events = new Event[100];
    private int index = 0;
    private int next = 0;
    public void add(Event e) {
    if(index >= events.length)
    return; // (In real life, throw exception)
    events[index++] = e;
    public Event getNext() {
    boolean looped = false;
    int start = next;
    do {
    next = (next + 1) % events.length;
    // See if it has looped to the beginning:
    if(start == next) looped = true;
    // If it loops past start, the list
    // is empty:
    if((next == (start + 1) % events.length)
    && looped)
    return null;
    } while(events[next] == null);
    return events[next];
    public void removeCurrent() {
    events[next] = null;
    public class Controller {
    private EventSet es = new EventSet();
    public void addEvent(Event c) { es.add(c); }
    public void run() {
    Event e;
    while((e = es.getNext()) != null) {
    if(e.ready()) {
    e.action();
    System.out.println(e.description());
    es.removeCurrent();
    } ///:~
    Event.java Code
    abstract public class Event {
    private long evtTime;
    public Event(long eventTime) {
    evtTime = eventTime;
    public boolean ready() {
    return System.currentTimeMillis() >= evtTime;
    abstract public void action();
    abstract public String description();
    } ///:~
    Is this problem easier than I think it is? I just don't know what to add to the linkedList. A LinkedList within a linkedList? I find this problem pretty difficult. Any help is muchly appreciated.
    Joe

  • Add one character at  a time from External Text file

    Hi,
    I'm using Flash 8, and I have created a standard Dynamic
    field that pulls the text from an external text file using the
    LoadVars function and it works fine.
    To get the correct effect for the design, I would like to be
    able to create the illusion that the characters are being typed out
    when the page loads as if someone has started typing and also hear
    the "Typewriter Clack" each time a character appears.
    The only place I have found an example is on the Syphon
    Filter Game website which seems to have created the illusion
    perfectly:
    http://www.syphonfilterdarkmirror-thegame.com/en_IE/
    (Check out the bottom right section)
    I could create a Movieclip and add a character each frame
    but, I would like to be able to edit the text when required via a
    text file or even ASP or PHP if neccessary.
    Any help would be grateful.
    Cheers

    or here:
    http://www.actionscripts.org/tutorials/beginner/Scripted_Typerwriter/index.shtml

  • Appending an external text file

    Hi everyone. I need a little help. I'm trying to append an external text file. I'm able to read it using the "in.readLine()" and "BufferedReader" commands but can't figure how to append it. The reason being is I'm trying to add new information to each new line. For example my ext. text file looks something like this:
    Homer Simpson 3489 Evergreen Terrace Springfield
    Marge Simpson 3489 Evergreen Terrace Springfield
    Bart Simpson 3489 Evergreen Terrace Springfield
    Please note that I'm not using a string tokenizer to read the text file. If someone could please give me an example to append information to each new line I would greatly appreciate it. Also please note that the text file is being read into a vector to hold the information. Thank you.

    open the FileWriter or FileOutputStream you use in "append" mode..
    http://java.sun.com/j2se/1.4.1/docs/api/java/io/FileOutputStream.html
    FileOutputStream(String name, boolean append)
              Creates an output file stream to write to the file
              with the specified name.http://java.sun.com/j2se/1.4.1/docs/api/java/io/FileWriter.html
    FileWriter(String fileName, boolean append)
              Constructs a FileWriter object given a file name
              with a boolean indicating whether or not to append
              the data written.

  • Changing .css property through external Javascript file?

    Hi,
    I'm trying to create all kinds of functions on an external .js file, so I can just call them in Edge multiple times with less coding. The thing is, after importing jQuery and my external Javascript file, some code works, but I get stuck at this part: changing the .css property of a symbol, more specifically, the "font-size" property. My current function is:
    function setFont(textid,fontsize,originalWinWidth){ //textid: symbol's name; fontsize: current font size of this symbol; originalWinWidth: window size at the start of the animation
    console.log("Set Font:");
    //set the original font size
    var originalFontSize = Math.round(originalWinWidth/fontsize);
    console.log("Original Font Size: " + originalFontSize);
    console.log("Text ID: " + textid);
    //set the font size using jquery
    sym.$(textid).css("font-size", originalFontSize);  }
    I get an error at the last line, all other parts of the code works. Any idea what this could be?
    Thanks,
    Rafael Carignato

    Have you tried sending textid to the console.log to make sure you're sending the actual name of the symbol and not a pointer to the symbol itself?
    -Elaine

  • Scroll bar with external text file

    Hello all,
    I need to make a flash movie with a graphic background with
    text from an external file.
    Ideally:
    1) The text file would NOT have to be imported into the flash
    movie. It would simply be in the same web folder as the flash file.
    2) Even better the text file would have a separate css file
    so I can change font size etc, while I tweak the movie, and get
    client approval.
    If 1 and 2 are not possible, then I can live with importing
    the text file. But CSS would sure be a nice addition!
    BTW I have Flaxh MX Professional 2004.
    Thanks
    Rowby

    Hey, I had to do a VERY similar thing for a student project a
    few months ago. If you go to
    Flashkit.com, you can find
    tutorials on how to import XML and CSS or XSL. I was able to do it
    and I don't know a lot of actionscript. If you want to see how I
    used it, go to
    the University of Scranton's MIT
    website.
    Hope that helps!

  • Handling external text files

    Hi experts!
    Would you give me some advice to find the best way for handling the situation below?
    Suppose I have a measuring system with 100 sensors. The measuring system can provide the measured values (with timestamp) through a simple text file (large amount of datas - one measuring session gives ~25,000 rows. The next session generates a new file: eg. data0001.csv, data0002.csv...).
    Suppose, this file will be deposit:
    A) somewhere on the db server (10g);
    B) somewhere on the data collector PC.
    The task is a data visualization on the datas already inserted into db table with Oracle ApEx. A package has to perform the observation of the new data files, the data insertion (and the visualization of course, but that I can manage).
    Would you be so kind to help finding the shortest way for this?
    What is the best practice (external table, sql*loader, utl_file...) for case A) and B), to create a "new data file listener" and "new data insertion" method?
    Thanks, ML

    user8353169 wrote:
    Would you be so kind to help finding the shortest way for this?Not sure what you define as the "+shortest+" way - but the best way would be not to write to files, but to write the sensor data directly into the database.
    The reasons are performance and scalability. One of the slowest operation we always had and still have on computer systems is I/O.
    Let's say you need to process 6GB of sensor data per hour. Thus you will have 6GB worth of I/O per hour. This data then needs to be read (another 6GB I/O) and loaded (another 6GB written) into Oracle - where it is also indexed (more I/O) and processed (likely you will have reporting tables or materialised views for your Apex reports - and this also needs I/O).
    Simply getting the data into the database using this method is 18+ GB I/O for 6 GB data. How well does this solution perform and how well does it scale when it has an I/O to data ratio of 3:1?
    Thus the better option is to write that 6GB/hour of sensor data directly into the database. And not to go the write-to-file and then load-from-file approach. A single client process (collecting sensor data) can easily write over 1MB/sec (2000+ rows/sec) into the database (based on my experience doing a similar type of thing). Of course - table type, indexes, triggers and so on impacts insert performance.
    The advantage of streaming the data directly into Oracle is, besides the reduction in total I/O, that the sensor data is almost immediately available for reporting and processing. Depending on the row/sec created, you may want to have the client commit every 10 to 60 seconds. Immediately after such a commit the database processes can access this data - process it for alarm notification, real-time reporting, aggregate it for a reporting data layer and so on.
    Doing this via text files instead.. I do not see any advantage in it. The best place for data is inside the database. Not outside. The sooner and faster the data can be put into the database, the better.

  • SSIS best practice on importing External text files

    Hi -
    I am a fairly seasoned SSIS/ETL developer and I am struggling with the best architecure on how to import vendor files into a shared database.  I see there being 2 methods with in importing files, and I'm really wanting input from senior
    level SSIS developers on their thoughts of importing vendor files, I see there being 2 methods:
    - Set up the ETL to match the format of the file, and if the format is invalid, the entire ETL is unable to process the file, various error handling will be set up to log that the file import failed, but at this point, the ETL can no longer continue
    - Set up the ETL to just take a text file, NOT looking at the format within the file, bring all of the data into ONE column, and then parse through the data, using the given file delimter and log any issues at that point
    I have done both methods and I think there are advantages and disadvantages to both.  Hopefully I explained that well enough. Can anyone give me their thoughts, suggestions, experience, etc. on these 2 approaches of importing a file?  Any input
    is greatly appreciated.
    Thanks!
    Jenna G

    It depends on how much control you've on the source end. If you can ,best thing always would be to prefix the metadata and create your package based on that. Any violation should be flagged as an error and reported back for correction with row/column details
    etc.
    If you've no way to fix the source, then only go for single column approach. But this can still prove to be a nightmare if the source format keeps on changing. Giving that flexibility to users can prove to be costly sometimes and you may have to spend quite
    a bit of time trying to fix inconsistencies in the source.
    So in my opinion best would be the former approach. Only thing is the format (matadata) has to be fixed only after sufficient discussions with all involved and exception handling also has to be agreed upon.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to access an external text file in a Servlet class?

    I do the regular file I/O in the Servlet class. But when I run Servlet class, text file is not loaded. Can sb tell me how to do it?
    Thanx
    Richard

    Hi DrClap;
    the following is the main servlet code, which calls other two classes.
    ===================================================================
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class TermsServlet extends HttpServlet {
              public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
              resp.setContentType("text/html");
              PrintWriter out = resp.getWriter();
              out.println("<HTML>");
              out.println("<TITLE>Computer Terms and Acronyms</TITLE>");
              out.println("<BODY>");
              out.println("<H1>Computer Terms and Acronyms</H1>");
              out.println("<TABLE BORDER=2>");
              out.println("<TR><TH>Term<TH>Meaning</TR>");
              TermsAccessor tax = new TermsAccessor("terms.txt");
              Iterator e = tax.iterator();
              while (e.hasNext()) {
                   Term t = (Term)e.next();
                   out.print("<TR><TD>");
                   out.print(t.term);
                   out.print("<TD>");
                   out.print(t.definition);
                   out.println("</TR>");
              out.println("</TABLE>");
              out.println("<HR></HR>");
              out.println("</BODY></HTML>");
    =================================================
    import java.io.*;
    import java.util.*;
    public class TermsAccessor {
         protected BufferedReader is;
         protected String ident;
         public TermsAccessor(String inputFileName) throws IOException {
              is = new BufferedReader(new FileReader(inputFileName));
              String ident = is.readLine();
         public String getIdent() {
              return ident;
         public Iterator iterator() {
         return new Iterator() {
              String line, term, defn;
    public boolean hasNext() {
              try {
              return ((line = is.readLine()) != null);
              } catch (IOException e) {
              System.err.println("IO Error: " + e);
              return false;
              public Object next() {
              int i;
              while ((i = line.indexOf("\t"))<0 && hasNext());
              if (line == null)
              throw new IllegalStateException("Invalid EOF state");
                        term = line.substring(0, i);
                        defn = line.substring(i+1);
                        return new Term(term, defn);
              public void remove() {
              throw new UnsupportedOperationException();
    =============================================================
    public class Term {
              public String term;
              public String definition;
              public Term(String t, String d) {
              term = t;
              definition = d;
    =================================================================
    part of [terms.txt] file as following:
    $Id: terms.txt,v 1.5 2000/03/17 04:08:55 $
    AMD     American Micro Devices: a chip maker that competes with Intel.
    API     Application Programmer Interface: a set of functions that a programmer can use
    ASP     Active Server Pages, a Microsoft technology for imbedding certain commands in HTML pages
    BSD     Berkeley Software Distribution, one of the two major flavors of UNIX. See OpenBSD
    C     A computer programming language invented for writing UNIX in, and very popular in the late 1970's through the 1990's
    C++     An Object-Oriented language heavily based on C; recently displaced by Java
    CGI     Common Gateway Interface; a script or program used to handle a form on a web page
    COBOL     COmmon Business Oriented Language, a programming language used mainly for large-scale financial applications.
    CPU     Central Processing Unit, the "chip" that gives a computer its low-level personality ("machine instruction set") and performs individual instructions (add, multiply, compare...). Common CPUs include Intel/AMD "PC", SPARC, Alpha.
    =================================================================
    the "terms.txt" file and above class files are under the same directory. I use J2EE server to deploy the file, after run, the erro mesage is:"The requested resource (terms.txt (The system cannot find the file specified)) is not available." That means server can not locate the terms.txt file. So what file path should I use?
    Thanx
    Richard

  • Need help to find link to external AS2 file

    I have purchased an image gallery program that works fine but I am struggling to make a very minor modification. I have asked the author for assistance but previous requests have met with no response so I am also asking my question here.
    This program has most of its logic in an external AS2 file. I have made some small changes to this file and want to save it under a new name. However, that would also require me to change the reference to the external AS2 file from within the fla file. That's where my problem lies. I can't find any code in the fla that contains such a reference.
    If I try to publish an swf without this file in the required location it causes a compiler error thus proving that there must be a reference somewhere to that file. However, doing a search for this AS2 file in the 'current document' when viewing the fla file in Flash CS4 produces no results. Where else could this reference be hidden?
    David

    Unfortunately, the Movie Explorer window does not show class references of the type under discussion. I guess an alternative way to reference this external file might be via an include statement in an action, which would make it a lot easier to find than when it is hidden in the properties box of a library symbol.
    However, the Movie Explorer appears to be a useful facility for finding and searching timeline actions so thanks for bringing it to my attention. I used it for a brief exploration of another fla file with lots of code scattered all over the place.
    Thanks again for all your help.
    David

  • Find words within a text file

    Hey all.
    I am playing around with the idea of finding a line of text within a text file, by using scanner and some next methods.
    The way I am trying to get it to work is that one enters a string and the program then finds all the lines of text containing that
    user-entered string and then prints them.
    The text file in question contains names of University papers and their room numbers, quantity of students etc.
    Example:
    IBUS212     EALT006     1am     72     AL     LI     
    BMSC241     MCLT102     2     pm     8     AL     COOREY     
    My problem annoyingly enough seems to be that I can't think how one could compare the string entered to the lines of text being
    scanned in the text file.
    My latest go involved what you see in the code, scanning the examdata.txt file for a user-entered course number, using course.next();
    by going with the example above it would be IBUS212. The task was to then to find all of the lines containing that number and print them out using
    println (what I have tried with id and line) as well as the rest of that line eg: EALT006     1am     72     AL     LI .
       public void printCourse()
        try
            String details, input, id, line;
            int count;
            Scanner user = new Scanner(System.in);
            System.out.println();
            System.out.println();
            System.out.println("Please enter your course ID: ");
            input = user.nextLine();
            Scanner course = new Scanner(new File("examdata.txt"));
            course.next();
            course.nextLine();
            id = course.next();
            line = course.nextLine();
            if(input.equals(id))
                System.out.println("Your course times are: "  + id + "and" + line);
            else
              System.out.println("Your course does not exist."); 
            catch(IOException e)
                System.out.print("File failure");
      }Any advice/help/troubleshooting would be greatly appreciated.
    Edited by: AUAN on Aug 13, 2009 9:43 AM
    Edited by: AUAN on Aug 13, 2009 9:44 AM
    Edited by: AUAN on Aug 13, 2009 9:49 AM

    You'll want [to loop while|http://java.sun.com/docs/books/tutorial/java/nutsandbolts/while.html] the course Scanner has a next line and then print the line if it contains the entered text.
    For useful methods you can check the Javadoc of String and Scanner (use your browser search on keywords like 'next' or 'contains' to find them).

  • How to find largest number from text file

    I am using the "Read from text file" block to read the data from my .txt file into labview.  It is now in string format.  I have many numbers in the file.  
    For example:
    0.45
    0.35
    0.12
    1.354
    1.56
    2.89
    5.89
    0.56
    That is what a text file might look like.  I want to find which of these numbers is largest, and do calculations with that number.  I am having trouble with strings/number formats/arrays, etc.  Thanks
    Solved!
    Go to Solution.

    The spreadsheet functions and VIs typically work on strings representing numbers separated by delimiters.  This is a typical way to save a "spreadsheet" (of numbers) to a text file, for example .csv files.  These are quite versatile and powerful functions.  Spend a bit of time becoming familiar with them because you may find yourself using them a lot.
    Lynn

Maybe you are looking for

  • How do I open file in acrobat instead of livecycle

    It seems that once a document is edited in Livecycle, it always opens livecycle but when a document is first created it goes through adobe acrobat. How do I edit a document that was edited in livecylce in acrobat instead? Is that even possible? Pleas

  • SQL*plus not displaying the result of XMLELEMENT

    HI, I am using SQL*Plus: Release 10.1.0.4.2 Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 When I run the following query in SQL*PLUS, I get nothing displayed. However when I run the same query connecting to the same database

  • Backup Failed and ALL historical backups have disappeared

    Please HELP!!! My Time Machine has stopped backing up (it says Backup Failed). Also, when I enter into time machine, ALL previous backups have disappeared!! However , the drive does appear on my Finder window, and he sparsbundle file still appears.

  • Universal Installer won't run in Linux

    When I try to run the Universal Installer from the hard drive in Red Hat Linux I get the following message Initializing Java Virtual Machine from /tmp/OraInstall2004-07-12_03-18-48PM/jre/bin/java. Please wait... /tmp/OraInstall2004-07-12_03-18-48PM/j

  • Voicemail has message 3 hours off

    My OS on my Unity server is set for the correct time & timezone (Pacific) but all voicemails are off by 3 hours (3 hours ahead) I have looked around in Unity & can't find where to set this. I am running CCM 4.1 Any suggestions?