Search Results

Search found 40999 results on 1640 pages for 'duplicate files'.

Page 163/1640 | < Previous Page | 159 160 161 162 163 164 165 166 167 168 169 170  | Next Page >

  • Reading different data from a textfile delimited with semicolons in C.

    - by Chris_45
    How do one read different records of data that are separated with semicolons into an array in C? from textfile: Text One; 12.25; Text Two; 5; Text Three; 1.253 fopen ... for(i = 0; i < nrRecords; i++) { fscanf(myFile, " %[^;];", myRecords[i].firstText); /* Ok first text*/ fscanf(myFile, "%lf", &myRecords[i].myDouble1); /* But goes wrong with first double */ fscanf(myFile, " %[^;];", myRecords[i].secondText); fscanf(myFile, "%d", &myRecords[i].myInt1); fscanf(myFile, " %[^;];", myRecords[i].thirdText); fscanf(myFile, "%lf",&myRecords[i].myDouble2); } fclose...

    Read the article

  • Scan Numbers among letters in a Sentence

    - by ZaZu
    Hello, I have a pretty easy question. (using C) In a sentence such as In this document, there are 345 words and 6 figures How can I scan 345 and 6 while ignoring all that is in between ? I tried fscanf(FILE *pointer,"%d %d",&words,&figs); But it only gets the first value ... What am I doing wrong ?

    Read the article

  • In a pre-commit hook - how to access/compare current and previous versions of files

    - by EthanML
    I'm trying to add to our existing pre-commit SVN hook so that it will check for and block an increase in file size for files in specific directory/s. I've written a python script to compare two file sizes, which takes two files as arguments and uses sys.exit(0) or (1) to return the result, this part seems to work fine. My problem is in calling the python script from the batch file, how to reference the newly committed and previous versions of each file? The existing code is new to me and a mess of %REPOS%, %TXN%s etc and I'm not sure how to go about using them. Is there a simple, standard way of doing this? It also already contains code to loop through the changed files using svnlook changed, so that part shouldn't be an issue. Thanks very much

    Read the article

  • How to change file contents in PHP ?

    - by Misha Moroshko
    I save in a file some info about users (like number of times user passed the login page, last visited time, and so on). I want to read this info from the file, and update it (add 1 to the counter, and change the last visited time). My question is: can I do it without opening the file twice ? I open the first time to read the contents, and then open it again to overwrite the contents with the updated ones. Thanks !

    Read the article

  • g++: Use ZIP files as input

    - by Notinlist
    We have the Boost library in our side. It consists of huge amount of files which are not changing ever and only a tiny portion of it is used. We swap the whole boost directory if we are changing versions. Currently we have the Boost sources in our SVN, file by file which makes the checkout operations very slow, especially on Windows. It would be nice if there were a notation / plugin to address C++ files inside ZIP files, something like: // @ZIPFS ASSIGN 'boost' 'boost.zip/boost' #include <boost/smart_ptr/shared_ptr.hpp> Are there any support for compiler hooks in g++? Are there any effort regarding ZIP support? Other ideas?

    Read the article

  • C#.NET Reload configuration settings from an external config file during run-time.

    - by user569850
    I'm writing a game server in C#.Net and would like to reload or refresh settings from a config file while the server is running. Ideally I would like to save the settings in an XML file, have the ability to edit the file while the game server is running and then send the server the command to reload the settings from the file. I know I can use a database to do this as well, but the game server is fairly small and I think it would be more practical to just save settings in a flat-file. I will have file-level access to the machine the server will run on. What should I use?

    Read the article

  • batch: replace a line in a text file

    - by sasamimasas
    I'm trying to replace this line: # forward-socks5 / 127.0.0.1:9050 . with this one: forward-socks5 / 127.0.0.1:9050 . this line belongs to a config file that has to be enabled (UN-commented) by deleting the # sign from the beginning and I could not thought of a better way other than replacing the line with another without the # sign. any other thoughts or ways would be very useful. btw, the spaces before the text are there also.I have pasted the text as it was in the original file. thanks in advance EDIT: I have somehow managed to do the line addition and removing using two peaces of code that I've found. my only problem is that the following code removes every bit of exclamation in the output file! @echo off :Variables SETLOCAL ENABLEDELAYEDEXPANSION set InputFile=config.txt set OutputFile=config-new.txt set _strFind=# forward-socks5 / 127.0.0.1:9050 . set _strInsert= forward-socks5 / 127.0.0.1:9050 . set i=0 :Replace for /f "usebackq tokens=1 delims=[]" %%A in (`find /n "%_strFind%" "%InputFile%"`) do (set _strNum=%%A) for /f "usebackq delims=" %%A in ("%InputFile%") do ( set /a i = !i! + 1 echo %%A>>"%OutputFile%" if [!i!] == [%_strNum%] (echo %_strInsert%>>"%OutputFile%") ) type %OutputFile% | findstr /i /v /c:"%_strFind%">config-new2.txt I was wondering if there is any way to do both the find/delete/add line in one step (not two steps as mine)...

    Read the article

  • Can you append a NSMutableArray to a file?

    - by Emil
    Hi. I am trying to write some data from an NSMutableArray to a plist, while keep the old plists content. The function writeToFile:atomically: overwrites the old contents with the new, I want to append the objects in the new array to the plist. How can this be done? Thank you.

    Read the article

  • simple c++ file opening issue

    - by Robert
    #include <iostream> #include <fstream> using namespace std; int main () { ofstream testfile; testfile.open ("test.txt"); testfile << "success!\n"; testfile.close(); return 0; } 1)called "g++ testfile.cpp" 2)created "test.txt" 3)called "chmod u+x a.out" 4)??? 5)file remains blank. I feel like an idiot for failing at something as trivial as this is supposed to be.

    Read the article

  • headers already sent displays after moving files from one server to another

    - by PERR0_HUNTER
    hey there! I have a project running on dreamhost hosting and it's working fine, but since DH has been getting really slow I'm moving the project to my new dedicated server. The thing is that after I move all of my file over to the new dedicated (ubuntu 8.4) I get see warnings all over the place telling me that the headers had been already sent. The first thing I tried was moving the files via FTP: download to my machine, upload to server - Didn't worked Second try was tar.gz the folder on the first server and untar it on the new one, didn't worked either I tried chaing enconding to ANSI and they start working, however most of my files contain accents so ANSI is not an option for all my files i need UTF8 Any ideas on how to fix this? I'm sure it must be some sort of config

    Read the article

  • Nuget and Source Control Files to Exclude?

    - by Peter Kellner
    I know I should be using nuget more but at this point I don't completely understand the nuances so I still tend to either get source and build the project, then reference the project, or I create my own "dlls" folder and hand copy the dll's in. As part of my learning process, I'm trying to understand what is critical and what is not when using nuget. For example, I've done install-package restsharp and now when I check into source control, I get files like "packages/RestSharp.103.4/lib/net4/RestSharp.xml". I'm assuming that nuget will help me with upgrading and such and it needs to have certain meta data type files. My question is: Should I be ignoring any or all files in the "packages" directory? If so, what and why. Thanks

    Read the article

  • UIWebView load remote html page with local images and javascript files

    - by BlueNile
    Im creating application that will display remote page on the UIWebView using local images and javascript/css files for faster loading. I want to avoid using cache because for this to work it must first load all the content. I was searching online for possible solution. Here is what I have: NSURLRequest *urlrequest = [ [NSURLRequest alloc] initWithURL: [NSURL URLWithString:urlString] ]; NSData *returnData = [ NSURLConnection sendSynchronousRequest:urlrequest returningResponse: nil error: nil ]; NSString *HTMLData = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding]; NSString *resourcePath = [[NSBundle mainBundle] resourcePath]; resourcePath = [resourcePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"]; resourcePath = [resourcePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; [webView loadHTMLString:HTMLData baseURL: [NSURL URLWithString: [NSString stringWithFormat:@"file:/%@//",resourcePath] ]]; urlString is defined and I moved files to the app bundle. Code works as I can see the remote page but no images nor javascript files are present.

    Read the article

  • how do I download a large file (via HTTP) in .NET

    - by nickcartwright
    I need to download a LARGE file (2GB) over HTTP in a C# console app. Problem is, after about 1.2GB, the app runs out of memory. Here's the code I'm using: WebClient request = new WebClient(); request.Credentials = new NetworkCredential(username, password); byte[] fileData = request.DownloadData(baseURL + fName); As you can see... I'm reading the file directly into memory. I'm pretty sure I could solve this if I were to read the data back from HTTP in chunks and write it to a file on disk. Does anyone know how I could do this?

    Read the article

  • How do I read hex numbers into an unsigned int in C [Solved]

    - by sil3nt
    I'm wanting to read hex numbers from a text file into an unsigned integer so that I can execute Machine instructions. It's just a simulation type thing that looks inside the text file and according to the values and its corresponding instruction outputs the new values in the registers. For example, the instructions would be: 1RXY - Save register R with value in memory address XY 2RXY - Save register R with value XY BRXY - Jump to register R if xy is this and that etc.. ARXY - AND register R with value at memory address XY The text file contains something like this each in a new line. (in hexidecimal) 120F B007 290B My problem is copying each individual instruction into an unsigned integer...how do I do this? #include <stdio.h> int main(){ FILE *f; unsigned int num[80]; f=fopen("values.txt","r"); if (f==NULL){ printf("file doesnt exist?!"); } int i=0; while (fscanf(f,"%x",num[i]) != EOF){ fscanf(f,"%x",num[i]); i++; } fclose(f); printf("%x",num[0]); }

    Read the article

  • Makefile rule depending on change of number of files instead of change in content of files.

    - by goathens
    I'm using a makefile to automate some document generation. I have several documents in a directory, and one of my makefile rules will generate an index page of those files. The list of files itself is loaded on the fly using list := $(shell ls documents/*.txt) so I don't have to bother manually editing the makefile every time I add a document. Naturally, I want the index-generation rule to trigger when number/title of files in the documents directory changes, but I don't know how to set up the prerequisites to work in this way. I could use .PHONY or something similar to force the index-generation to run all the time, but I'd rather not waste the cycles. I tried piping ls to a file list.txt and using that as a prerequisite for my index-generation rule, but that would require either editing list.txt manually (trying to avoid it), or auto-generating it in the makefile (this changes the creation time, so I can't use list.txt in the prerequisite because it would trigger the rule every time).

    Read the article

  • keyboard gets locked when editing source controlled files using Visual Studio 2008

    - by Rama
    Hi, I am facing a strange issue with editing source controlled files (especially aspx files) using visual studio 2008. when I check out and edit the file, I can edit fine for few seconds and after that keyboard gets locked and I can't type anything (it doesn't affect the files not added to source control). as soon it is locked, if I try to type, the focus shifts to solution explorer and other windows and sometimes it freezes and doesn't respond at all. I tried uninstalling and reinstalling visual studio, reinstalling the source control plug-in. none of it worked. not sure if it is my machine or my profile. Please help if you have any clues. I can't see any other solution for this except rebuilding the machine Update: I use Perforce plug-in for source control Thanks, Rama

    Read the article

  • Is there an easier way to reconcile a list of files and a directory with subfolders/files to find ch

    - by rwmnau
    I have a SQL Server table with a list of files (path + filename), and a folder with multiple layers and files in each layer. I'm looking for a way to reconcile the two without having to process the list twice. Currently, I'm doing this: For Each f as FileInfo In FileListFromDatabase If f.Exists is False, mark it as deleted in the database Next For Each f as FileInfo In RecursiveListOFFilesOnDisk If Not FileExistsInDatabase, then add it Next Is there a better way to do this? I'd like to avoid converting all the matching files (of which most will be) to FileInfo objects twice. Since I'm a T-SQL developer first, I'm picturing something like an OUTER JOIN of the two lists where they don't match. Something LINQ-ish?

    Read the article

  • Quick question regarding Conditional Compilation (ifndef)

    - by sil3nt
    Hello, This is quite probably a very silly question but I need to be sure. I've been given a class declaration in a header file eg. #ifndef file_H #define file_H class ex{ private: public: }; #endif and I've been required to write the method definitions in the same file, which I have done, my question is does the "#endif" stay where it is just after the class declaration or does it go at the end of my file after the class method definitions?.

    Read the article

  • Fastest file reading in C.

    - by Jay
    Right now I am using fread() to read a file, but in other language fread() is inefficient i'v been told. Is this the same in C? If so, how would faster file reading be done?

    Read the article

  • Require_once to variable

    - by swamprunner7
    I want to call require_once("test.php") but not display result and save it into variable like this: //pseudocode $test = require_once('test.php'); //some operations like $test = preg_replace(…); echo $test; Is it possible?

    Read the article

< Previous Page | 159 160 161 162 163 164 165 166 167 168 169 170  | Next Page >