Search Results

Search found 72319 results on 2893 pages for 'file explorer'.

Page 99/2893 | < Previous Page | 95 96 97 98 99 100 101 102 103 104 105 106  | Next Page >

  • String replacement in batch file

    - by Faisal
    We can replace strings in a batch file using the following command set str="jump over the chair" set str=%str:chair=table% These lines work fine and change the string "jump over the chair" to "jump over the table". Now I want to replace the word "chair" in the string with some variable and I don't know how to do it. set word=table set str="jump over the chair" ?? Any ideas?

    Read the article

  • How to execute a batch file from C#?

    - by Jim C
    I didn't think this was going to be hard. I have a commmand file, d:\a.cmd which contains: copy /b d:\7zS.sfx + d:\config.txt + d:\files.7z d:\setup.exe But this line of C# wont' execute it: Process.Start("d:\\a.cmd"); Throws Win32Exception: "%1 is not a valid Win32 application." Process.Start opens .pdf files...why not execute command files? Thanks in advance, Jim

    Read the article

  • Most efficient way to search the last x lines of a file in python

    - by Harley
    I have a file and I don't know how big it's going to be (it could be quite large, but the size will vary greatly). I want to search the last 10 lines or so to see if any of them match a string. I need to do this as quickly and efficiently as possible and was wondering if there's anything better than: s = "foo" last_bit = fileObj.readlines()[-10:] for line in last_bit: if line == s: print "FOUND"

    Read the article

  • Batch file command line arguments

    - by Hema Joshi
    I want to pass a command as a command line argument from one batch file to another e.g. first.bat call test.bat "echo hello world" "echo welcome " test.bat set initialcommand=%1 set maincommand=%2 %maincommand% %initialcommand%

    Read the article

  • How to find all the file handles by a process programmatically?

    - by kumar
    I have a process "x" which uses "system" C function to start ntpd daemon. I observed that ntpd are passed the open file descriptors of "x". ntpd holds on to the file descriptors even after original file is deleted. for ex: Some log files used by "x" are rotated out after sometime, but "ntpd" has file handle opened for these deleted files. Will it cause any problem? Alternatively I thought of setting "FD_CLOEXEC" flag for all the file descriptors before calling "system" function. But as we are running as an extension library to third process "x"( "x" loads our library based on some condition), there is no easy way to know about all the file descriptors process has opened. One way is to read /proc//fd and set "FD_CLOEXEC" for each file handle and reset it back after "system" function returns. I'm using Linux 2.16. Is there any other easy way to find all the file handlers? Thanks,

    Read the article

  • SQL query in JSP file pulling variable from VXML file

    - by s1066
    Hi I'm trying to get an SQL query to work within a JSP file. The JSP file is pulled by a VXML file here is my JSP file code: <?xml version="1.0"?> <%@ page import="java.util.*" %> <%@ page import="java.sql.*" %> <% boolean success = true; // Always optimistic String info = ""; String schoolname = request.getParameter("schoolname"); String informationtype = request.getParameter("informationtype"); try { Class.forName("org.postgresql.Driver"); String connectString = "jdbc:postgresql://localhost:5435/N0176359"; String user = "****"; String password = "*****"; Connection conn = DriverManager.getConnection(connectString, user, password); Statement st = conn.createStatement(); ResultSet rsvp = st.executeQuery("SELECT * FROM lincolnshire_school_information_new WHERE school_name=\'"+schoolname+"\'"); rsvp.next(); info = rsvp.getString(2); }catch (ClassNotFoundException e) { success = false; // something went wrong } %> As you can see I'm trying to insert the value of the variable declared as "schooname" into the end of the SQL query. However when I come to run the jsp file it doesn't work and I get an error "ResultSet not positioned properly". When I put a standard query in (without trying to make it value of the variable it works fine) Hope that makes sense, and thank you for any help!

    Read the article

  • Decompressing file with gzip produces file with no read-permissions on Windows 7

    - by Abiel
    I am attempting to decompress a .gz file using the GnuWin32 gzip program in Windows 7. I have full permissions on the compressed file, and my user account is an administrator. However, I end up not having read permissions on the decompressed file. To get read permissions I would have to manually change the permissions on it through right-clicking and selecting Properties Security. I am able to do this exact same thing with no permission problems in Windows XP, which leads me to believe that Windows 7's user account control system is causing problems. Does anyone know what I can do to make things work as I would expect (read permission on the decompressed file) in Windows 7? Thanks.

    Read the article

  • Reading a file N lines at a time in ruby

    - by Sam
    I have a large file (hundreds of megs) that consists of filenames, one per line. I need to loop through the list of filenames, and fork off a process for each filename. I want a maximum of 8 forked processes at a time and I don't want to read the whole filename list into RAM at once. I'm not even sure where to begin, can anyone help me out?

    Read the article

  • How to open a .a file

    - by Mgst
    Heya! My name is Ale, and this is the first time that I post in this website. I've a little problem: I have to open a linker file, that have ".a" extension. I use Dev-C++, I don't know if it would be useful for you :-P I hope you will answer soon! Oh, and excuse me for my bad English, tell me if I made some mistakes! Thanks!!

    Read the article

  • Queuing asynchronous HTTP file uploads

    - by David Parunakian
    Is there a way to queue file uploads without resorting to Flash or Silverlight, just with cleverly used forms and JavaScript? Note that the upload should be executed asynchronously. By "queuing" uploads I mean that if the user tries to upload multiple files, they should not be transferred simultaneously, but rather one at a time, in a single HTTP connection.

    Read the article

  • how to read a static file in .py file using django ..

    - by zjm1126
    this is my error code: text = open('/media/a.txt', 'rb').read() and my perplexed is: when i use this : text = open('a.txt', 'rb').read() it can be running but when i put the 'a.txt' to the 'media' folder, i can't running , why ? thanks IOError at / [Errno 13] file not accessible: '/media/a.txt'

    Read the article

  • Want to create an open file with filter in eclipse3.4

    - by Ravisha
    I am using eclipse 3.4.I often keep searching for files in my project.I wanted to create a file search with filter.Like i should be able to configure the filter in preferences.later when i press ctrl+shift+ F (Assuming this is what i give the shortcut) it should display only those files. Why i came up with this is bcos i might want to avoid java files while searching.So life becomes little easier.

    Read the article

  • Python File Search Line And Return Specific Number of Lines after Match

    - by Simos Anderson
    I have a text file that has lines representing some data sets. The file itself is fairly long but it contains certain sections of the following format: Series_Name INFO Number of teams : n1 | Team | # | wins | | TeamName1 | x | y | . . . | TeamNamen1 | numn | numn | Some Irrelevant lines Series_Name2 INFO Number of teams : n1 | Team | # | wins | | TeamName1 | num1 | num2 | . where each section has a header that begins with the Series_Name. Each Series_Name is different. The line with the header also includes the number of teams in that series, n1. Following the header line is a set of lines that represents a table of data. For each series there are n1+1 rows in the table, where each row shows an individual team name and associated stats. I have been trying to implement a function that will allow the user to search for a Team name and then print out the line in the table associated with that team. However, certain team names show up under multiple series. To resolve this, I am currently trying to write my code so that the user can search for the header line with series name first and then print out just the following n1+1 lines that represent the data associated with the series. Here's what I have come up with so far: import re print fname = raw_input("Enter filename: ") seriesname = raw_input("Enter series: ") def findcounter(fname, seriesname): logfile = open(fname, "r") pat = 'INFO Number of teams :' for line in logfile: if seriesname in line: if pat in line: s=line pattern = re.compile(r"""(?P<name>.*?) #starting name \s*INFO #whitespace and success \s*Number\s*of\s*teams #whitespace and strings \s*\:\s*(?P<n1>.*)""",re.VERBOSE) match = pattern.match(s) name = match.group("name") n1 = int(match.group("n1")) print name + " has " + str(n1) + " teams" lcount = 0 for line in logfile: if line.startswith(name): if pat in line: while lcount <= n1: s.append(line) lcount += 1 return result The first part of my code works; it matches the header line that the person searches for, parses the line, and then prints out how many teams are in that series. Since the header line basically tells me how many lines are in the table, I thought that I could use that information to construct a loop that would continue printing each line until a set counter reached n1. But I've tried running it, and I realize that the way I've set it up so far isn't correct. So here's my question: How do you return a number of lines after a matched line when given the number of desired lines that follow the match? I'm new to programming, and I apologize if this question seems silly. I have been working on this quite diligently with no luck and would appreciate any help.

    Read the article

  • Best language for scripting large scale file management

    - by Dan
    The National Park Service's Natural Sounds Program collects multiple terabytes of data each year measuring soundscapes. In your opinion, what is best available scripting language to manage massive amounts of files and file types? We would like to easily design and run efficient user-friendly scripts to search for and retrieve/create copies of files that may be located in different directories according a single static hierarchy. The OS will most likely be windows. Thanks!

    Read the article

  • Bash: How to flush output to a file while running

    - by noam
    I have a small script, which is called daily by crontab using the following command: /homedir/MyScript &> some_log.log The problem with this method is that some_log.log is only created after MyScript finishes. I would like to flush the output of the program into the file while it's running so I could do things like tail -f some_log.log and keep track of the progress, etc.

    Read the article

< Previous Page | 95 96 97 98 99 100 101 102 103 104 105 106  | Next Page >