Re: Read, Edit and Write to File Programming Software Development by Ram_034 With this code we able to modify the first line of text. For example i have text file with 5 text lines and i want to modify first 5 chars of first word then how handle this Re: sequential file save read option button Programming Software Development by rproffitt …. You could have posted the code snippet along with what lines you think the problem is at. Finally there's the… read lines from file which gets updated at same time Programming Software Development by CoolAtt hi. actually i hv to read lines from a file which is getting updated at the same time( new lines are appended at the end of the file). plz suggest a way to implement it in c. thx. Read Lines from a file Programming Software Development by bhanu1225 Hi all. I am newbie to python. I need a starting step to get through it. [COLOR="Red"]How to read lines from a file.[/COLOR] I need the solution. Re: read lines from file which gets updated at same time Programming Software Development by Murtan … when all of the data has been read, or does it keep trying to read in case the updater puts more data… Re: read lines from file which gets updated at same time Programming Software Development by CoolAtt yes , it keep trying to read in case the updater puts more data into the file. reader should stop reading the file once a date & time criteria is met. Re: read lines from file which gets updated at same time Programming Software Development by Murtan …) on the file in the reader to get it to read more data afterward. Re: read lines from file which gets updated at same time Programming Software Development by CoolAtt ok will do that. instead of making the program sleep, will it be ok to check everytime in an infinite loop for the following: if fgets is not null -> read & process Re: read lines from file which gets updated at same time Programming Software Development by CoolAtt ok. plz give an overview. the sequence of steps i mean. is my understanding correct ? while(1){ if fgets == NULL{ sleep clearerr } else read & process string } Re: read lines from file which gets updated at same time Programming Software Development by Murtan That looks pretty close. Remember that just because fgets() did not return NULL does NOT mean that it read a complete input line. (It is possible for fgets to return with a partial line of data if there is a partial line of data at the end of the file.) Re: Read Lines from a file Programming Software Development by _Nestor … which you want to open the # file in this case read mode thefilesText = thefile.readlines() thefile.close() for text in thefilesText… other methods such as read depending on how you want to read from the file i suggest you read the python documentation to… Re: Read Lines Programming Software Development by stultuske so, you read in an int, and you want to read the line on that number spot? read your file line by line, and keep a counter, which you add 1 to each time you read a new line. if your counter is the same as your entered value, you've got your line. Read Lines Programming Software Development by mehnihma …); // private ArrayList <String> lines = new ArrayList<String>(); public DefectListener…) { area.append(line +"\n"); //lines.add(line); } in.close(); area.setEditable(true);… read line from file Programming Software Development by solaf_111 hello for all i read lines from file as : getline(infile,word); but i want put condition :don't read the spaces that in begin of lines this problem appear with me now when i end my project :'( please help me Read-, sort- and save textfile ("movie-library") Programming Software Development by foxmulder …I was told do create a program which can read-, sort- sand save a textfile (.txt). For …5 movies, this file is going to be read by the program and then sorted (in alphabetical …>> Word ) { Quantity++; } cout << "Read " << Quantity << " words." &… get it to work, and I must read lines not words :/ Re: Read lines from file contains HTML content Programming Web Development by veledrom I think it will never work when I try to echo html code in a page unless trying to echo it into textarea etc. I'm **exit**ing because the txt file many lines so I was just testing with one line only. In browser code view, **<spa** is being printed correctly. Read lines from file contains HTML content Programming Web Development by veledrom …;/a></span></h2> **PHP to read the file** <?php $handler = fopen('index.txt','r'); while… Re: read lines from file which gets updated at same time Programming Software Development by Murtan Sounds fairly straightforward then. Make sure you plan that the reader might be able to get a 'partial' record from the updater. It is possible that the processor might swap from one app to the other before the record is completely written. For file sharing, look at "FileShare Enumeration" for .Net in MSDN Re: read lines from file which gets updated at same time Programming Software Development by CoolAtt will implement in C. cant we make the fgets() wait until the updater writes some new line ? Re: read lines from file which gets updated at same time Programming Software Development by CoolAtt i tried this piece of code: while (1) { fgets(buffer,1024,myfile); printf("%s\n",buffer); } the prob is that wen it reaches the end of file , it keeps on printing the last line. Re: read lines from file which gets updated at same time Programming Software Development by Salem > the prob is that wen it reaches the end of file , it keeps on printing the last line. You ignore the return result of fgets() You could try detecting that - fgets() returns NULL - then sleeping for a while, in the hope the file will grow - call clearerr() to reset the EOF condition. Re: read lines from file which gets updated at same time Programming Software Development by Murtan No, you would be MUCH better off sleeping. If you don't sleep the CPU shows 100% utilization and things slow down, including the other program trying to write the data. I would start the sleep at 1 second (1000 ms) and wouldn't reduce it unless the performance required it. Re: Shell script to read lines in a text file and filter user data Programming Software Development by e04047 …://www.linuxquestions.org/questions/linux-newbie-8/shell-script-to-read-lines-in-a-text-file-and-filter-user-data-763384/[/url… Re: Read Lines Programming Software Development by stultuske what is the actual problem, and what error message do you get? btw: [Code=Java] catch (NumberFormatException n) { System.out.println("BUUUU"); } [/Code] this will do no good at all, replace it (everywhere you have a structure like this) by [Code=Java] catch (NumberFormatException n)… Re: Read Lines Programming Software Development by mehnihma the problem is that I do not know how to choose that specific line and count a word defect in that line of text Re: Read Lines Programming Software Development by mehnihma this part i the problem [CODE]else if(e.getSource() == jbInspect) { try{ String value = jtfRow.getText(); numberRows = Integer.parseInt(value); String linN = area.getText(); //String selectedLine = get //lnr = new LineNumberReader(fr); //area.setLineNumber(numberRows); [/CODE] Re: Read Lines Programming Software Development by stultuske how are you supposed to choose a line? the #th line in a file? line with a certain index? Re: Read Lines Programming Software Development by mehnihma I need to enter a line in a gui Re: read info from txt file Programming Software Development by spywx2003 …inputFromFile(String filename,String[] lines) { TextFileInput in = new TextFileInput("inputFile.txt"); // Read lines into array: int i …= 0; int arraySize=lines.length; String line = in.readLine(); // read first line… Re: lines of codes program Programming Software Development by ezkonekgal Mr Tong1, i was wondering.. Could it be possible to restrict file to be choosen by the fileDialog.. like wen the dialog opens.. since the program will read lines of code... could i restrict it to accept .java files and .txt files?