Hi. I'm creating a web crawler, I want to send the output into a txt file, how can I do it? And I also want to give a path to the script to set the directory. How can I do it now?

Member Avatar
Member Avatar
+0 forum 1

Hi, I have writen web sites before but have been asked to create a VB program, but dont know where to start so hoping someone can help me. I need to create a program that sits waiting for data from the serial port which is attached to a set of scales, when the scales are triggered they send the weight of the object down the serial port to the pc that then writes the data to a text file and then waits for the next weight to be received, and continuous to run until stopped at the end of the …

Member Avatar
Member Avatar
+0 forum 5

Hi, is there a simple way to convert the xls file to txt file to fit my program's code. import matplotlib.pyplot as plt x = [] y = [] t = [] fig = plt.figure() rect = fig.patch rect.set_facecolor('#31312e') **readFile = open('data.xls', 'r') sepFile = readFile.read().split('\n') readFile.close()** for idx, plotPair in enumerate(sepFile): if plotPair in '. ': # skip. or space continue if idx > 1: # to skip the first line xAndY = plotPair.split(',') time_string = xAndY[0] t.append(time_string) y.append(float(xAndY[1])) ax1 = fig.add_subplot(1, 1, 1, axisbg='blue') ax1.plot(t, y, 'c', linewidth=3.3) plt.title('IRRADIANCE') plt.xlabel('TIME') plt.show()

Member Avatar
Member Avatar
+0 forum 1

Hi Guys, I'm Using Python 2.7.3 This is my txt file: TimeStamp,Irradiance 21/7/2014 0:00,0.66 21/7/2014 0:00,0.71 21/7/2014 0:00,0.65 21/7/2014 0:00,0.67 21/7/2014 0:01,0.58 21/7/2014 0:01,0.54 21/7/2014 0:01,0.63 21/7/2014 0:01,0.65 21/7/2014 0:02,0.64 21/7/2014 0:02,0.63 21/7/2014 0:02,0.63 21/7/2014 0:02,0.64 . . . . 22/7/2014 23:57,0.53 22/7/2014 23:58,0.69 22/7/2014 23:58,0.61 22/7/2014 23:58,0.65 22/7/2014 23:58,0.59 22/7/2014 23:59,0.63 22/7/2014 23:59,0.67 22/7/2014 23:59,0.68 22/7/2014 23:59,0.58 How can i find the average/mode/max value of my txt file data and display it My program is using the data above and letting user to choose from time & to time then plot the user selected criteria (which i had done) …

Member Avatar
Member Avatar
+0 forum 5

hi guys below is my attempted code, how can i plot date and time(x-axis) versus a value (y-axis) import matplotlib.pyplot as plt from datetime import time, datetime x = [] y = [] t = [] fig = plt.figure() rect = fig.patch rect.set_facecolor('#31312e') readFile = open('data.txt', 'r') sepFile = readFile.read().split('\n') readFile.close() for idx, plotPair in enumerate(sepFile): if idx > 1: # to skip the first line xAndY = plotPair.split(',') time_string = xAndY[0] datetime_obj = datetime.strptime(time_string, '%d/%m%Y %H:%M:%S') t.append(datetime_obj) y.append(float(xAndY[1])) ax1 = fig.add_subplot(1, 1, 1, axisbg='blue') ax1.plot(t, y, 'c', linewidth=3.3) plt.title('IRRADIANCE') plt.xlabel('TIME') plt.show() this is my txt file: TimeStamp,Irradiance 21/7/2014 0:00,0.66 …

Member Avatar
Member Avatar
+0 forum 6

I'm trying to create a .txt reader and inserting the read data to the cleansheets software we are editing in class but instead of putting the correct data it does nothing. I made some prints and this is what I obtain: D:\Documentos\Desktop\ImportTest.txt cacacaca ----- [[Ljava.lang.String;@73a175] cacacaca ----- [[Ljava.lang.String;@73a175, [Ljava.lang.String;@364cf2] cacacaca ----- [[Ljava.lang.String;@73a175, [Ljava.lang.String;@364cf2, [Ljava.lang.String;@5f3215] cacacaca ----- [[Ljava.lang.String;@73a175, [Ljava.lang.String;@364cf2, [Ljava.lang.String;@5f3215, [Ljava.lang.String;@5a421d] cacacaca ----- [[Ljava.lang.String;@73a175, [Ljava.lang.String;@364cf2, [Ljava.lang.String;@5f3215, [Ljava.lang.String;@5a421d, [Ljava.lang.String;@1f528ea] cacacaca ----- [[Ljava.lang.String;@73a175, [Ljava.lang.String;@364cf2, [Ljava.lang.String;@5f3215, [Ljava.lang.String;@5a421d, [Ljava.lang.String;@1f528ea, [Ljava.lang.String;@12aa4ba] cacacaca ----- [[Ljava.lang.String;@73a175, [Ljava.lang.String;@364cf2, [Ljava.lang.String;@5f3215, [Ljava.lang.String;@5a421d, [Ljava.lang.String;@1f528ea, [Ljava.lang.String;@12aa4ba, [Ljava.lang.String;@e4e190] cocococo ----- [[Ljava.lang.String;@a011bb cocococo ----- [[Ljava.lang.String;@a011bb cocococo ----- [[Ljava.lang.String;@a011bb cocococo ----- [[Ljava.lang.String;@a011bb cocococo ----- [[Ljava.lang.String;@a011bb cocococo …

Member Avatar
Member Avatar
+0 forum 2

All, What is the most efficient way of writing several lines of data to a *.txt file? Currently, I store the required text in memory then write it all to a user-specified text file at the end, similar to the following; Dim text As String = "" text = text + "1st line of text" & vbNewLine text = text + "2nd line of text" & vbNewLine text = text + "3rd line of text" & vbNewLine Dim path As String = "C:\Temp\fileName.txt" My.Computer.FileSystem.WriteAllText(path, text, True, System.Text.Encoding.Default) This works well enough for up to about 1000 lines of text. However, …

Member Avatar
Member Avatar
+0 forum 5

Im new to programming python3 and i'm trying to write a password program. i want to compare a word from a .txt file with a input. no matter if i type the password in write or wrong it always comes up 'access denied!' inFile = open('passwordtest.txt', 'r') password = inFile.read() userguess = input("Enter password: ") if password == userguess: print('Access Granted!') else: print('Access Denied!') input() Thank you in advanced!!

Member Avatar
Member Avatar
+0 forum 3

I have read pretty much about xml. I know that it is good to save data inside but i just can t get it why wouldn t I save my data into a .txt file once finished with my program tasks. Is it because xml offers a structural and more simple way of storing data (refering to the xml parent and child tags).I just can t see xml being a advanced technology for data saving and transportation. If you can give me a clearer view on xml because always when I investigate the net they always lack to provide an …

Member Avatar
Member Avatar
+0 forum 1

Hello, I would appreciate some help to import data from a text file to a datagridview. If anyone could give me a hint to get started... The textfiles have the column name in the "[ ]" I would like to read the data after the [wp], [pos], [rad] blocks, the data inside [] is not needed in the datagridview. My problem is that I don't know where to start, If I need to read line by line, and strip the text after reading? Sample of textfile: [route] "350 Mongstad - Aasgard C" [wp] "H Graa" [pos] 605100.00 0042600.00 [rad] 1852.00 …

Member Avatar
Member Avatar
+0 forum 2

Alright I'll try to be as clear as possible. I'm currently doing tutorials online because I'm learning php. I'm stuck on an issue I'm not really sure of. I'm currently coding on my local machine and think it may have something to do with that, but I'm not sure. Here it is. This currently involves 2 files(count.php and ip.txt) Here's the first script(count.php): <?php function hit_count() { $ip_address = $_SERVER['REMOTE_ADDR']; $ip_file = file('ip.txt'); foreach ($ip_file as $ip) { $ip_single = trim($ip); if ($ip_address!=$ip_single) { $found = false; } else { $found = true; } if ($found==false) { echo 'IP not …

Member Avatar
Member Avatar
+0 forum 4

Sir, I have 2 column having so many points. In the 2nd column there r 3 highest peak points like(6,4 and3) bellow 6 5 5 4 4 4 3 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 2 3 4 5 6 7 8 9 0 11 12 13 14 15 16 17 18 19 20 21 22 23 24 How can i peak up these 3 points(6,4 and 3) and corresponding 1st column value like(7,14,21)above. By the help of expert brother, i got the following code to input 2 column from …

Member Avatar
Member Avatar
+0 forum 12

Can you please help !! Here, you see that const int size=25; Actually, How can i use infinite number like (n). I used "n" like bellow int n; const int size = n; however it only takes 8 values. My txt file can contained different value(n) evrytime, so, i dont want to keep the const int size fixed. please help me. If I keep const int value, i can't use for more/less number. To da this always i have to change const int size value. the software given bellow. #include<iostream> #include<fstream> #include<string> #include<cstdlib> #include<cmath> #include<iomanip> #include <windows.h> using namespace std; …

Member Avatar
Member Avatar
+0 forum 8

Hi Everyone, have got this application that exports multiple files bit gives them random names, i would like to rename all the files in the folder to the first 3 characers on the firstline then put an underscore and then the first 5 characters on the seconline **example** randomfile_001.txt contain the following lines Abc/xyz def12/pqr to become Abc_def12.txt is there a way to rename in vbs or .bat thanks alot

Member Avatar
+0 forum 0

Hi all How i can read txt file and put it into textbox? Please help me. Any help will be appreciated. Thank you

Member Avatar
Member Avatar
+0 forum 3

#include <stdio.h> #include <string.h> #include <conio.h> #include<stdlib.h> int fstock1, fstock2, fstock3; int opt1, opt2, cCost, length, gTotal; int stock1= 5; int stock2= 10; int stock3= 15; //--------------------------------------------------------------------------------------------- void welcome() { system ("cls"); printf ("\n ||||''|| . ...\n"); printf (" |||| ||| |||''|| '||| |||. .|| ||| .||''||.\n"); printf (" |||| |||' ''' ||| |||' .||| .||||||| .' ||| '''''\n"); printf (" ||||'''|| ....||| ||| ||| '||.....\n"); printf (" |||| '||| ||| ||| ||| ||| ..... '||.\n"); printf (" |||| .|| |||| ||| : ||| ||| : '|| .||'\n"); printf (" ''''''''' ''''''''' ''''' ''' '''''''\n"); printf ("\n\t\t\t\t\t\tCAR RENTAL COMPANY\n"); printf …

Member Avatar
Member Avatar
-1 forum 4

I'm given a text document with marks and course codes, and I need to create a function where you input the directory of the file, and the course code. Doing so, the code will return the average mark of all the marks in the text with that course code. Any ideas?

Member Avatar
Member Avatar
+0 forum 2

Does anyone know COBOL and how to retrieve data from a txt file? I have a list of words (1 word per line) and i want to retrieve them one by one randomly using cobol. thanks.

Member Avatar
Member Avatar
+0 forum 5

Hi. Can you help me read a two digit like "12" from an input.txt file, is it advisable to use fscanf or fgets? This is a sample of the txt file : a(1,4,3,12,15) Thanks :)

Member Avatar
Member Avatar
+0 forum 3

Hello everyone, Im a beginner in vb.net and currently Im developing a program where i save date to a txt file like this Reminder#dinner#26-07-2012 19:52:00 and show it in a listbox(all the lines in the txt file). What i want to do is to select a line(item) in the listbox and delete it in the txt file. How can i delete a line of a txt file by selecting it from the listbox? I already can check if the line(i) its equal to the selected item of the textbox Heres the code that i have: Private Sub Button3_Click(ByVal sender As …

Member Avatar
Member Avatar
+0 forum 12

Hello to everyone, Im a beginner in vb.net and currently Im developing a "reminder" program, the user inserts a task that he as to do, the date and the time to be remimbered! Im saving the task in a txt file like this, "Make dinner,Reminder,24-07-2012 18:31:00", but line by line, each task in a diferent line. The insert of the task and the pop up of the alarm are working fine, but i have a problem and that is, when the alarm goes one showing the task to the user and for some reason he needs to change something in …

Member Avatar
Member Avatar
+0 forum 2

Hello Guys , I want to create a script that convert a text file or Nfo file to an image(format is .PNG). What it does is simply load the txt and output it as an image Here is my code: <?php if(isset($_FILES['image'])){ $errors = array(); $allowed_ext = array('txt'); $file_name = $_FILES['image']['name']; $file_ext = strtolower(end(explode('.', $file_name))); $path = $_SERVER['DOCUMENT_ROOT'].'/fileupload'.'/images/'; if(in_array($file_ext, $allowed_ext) ===false){ $errors [] = 'Extension not allowed.'; } if ($file_ext =='txt') { $font_file = "C:/WINDOWS/Fonts/cour.ttf"; $nfo_file_lines = file($file_name); $width = 0; for($i = 0; $i < count($nfo_file_lines); $i++) { $box = imagettfbbox($file_size, 0, $font_file, $nfo_file_lines[$i]); $width = max($width, $box[2]); } …

Member Avatar
Member Avatar
+0 forum 5

So I have a text file that has 4 items in each line. I would like to store these into an array. So this is an example of how they are stored: imgur.com | link.com | 60 | 468 Thanks in advance

Member Avatar
Member Avatar
+0 forum 1

Hey guys, i'm Working On A Project That Gets All Employees And Their Data From the User Then Saves Them in A Txt File ( Fstream ) Anyway, i figured out how to Do That But What im at stuck at now is how to search through the txt file , i figured that i got to get all the data from the txt file into the console when i start the program so i did all of that and divided all the data between < > For example : < ID > <Name > <Rank>... etc so When he …

Member Avatar
Member Avatar
+0 forum 4

it gets compiled but it crushes: "programm has stopped working" Please help me!!! this is the programm: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { FILE *fp; int i=0, n; char allwords[100][40]; fp=fopen("fraoules.txt","r"); if ( (fp=fopen("fraoules.txt","r") )==NULL ){ printf("To arxeio den mporese na anoixtei\n"); } while(strcmp( allwords[i],"telos")!=0){ fscanf(fp, "%s", allwords[i+1]); i++;} fclose(fp); for(n=0; n<i; n++) printf("%s", allwords[n]); system("PAUSE"); return 0; }

Member Avatar
Member Avatar
+0 forum 3

Hi I was ask to do a code in c wich read the contenent inside a txt file and display it then after display it they wan't me to tokenize those command and interpretate them in c. I have no experience in c if someone can show me how to read a txt and make c do a command i apreciate it. sorry if my english is not good. this is mi text file virtual.txt int x; printline("<html><body>"); while(x=!10){ printline("<h1>this is a test<\h1>"); x++; } printline("</body></html>"); this is my code to display it's contenents #include <stdio.h> #include <stdlib.h> int main() …

Member Avatar
Member Avatar
+0 forum 4

OK, I'm new to VB.Net so forgive me if this was covered else where and my search foo was week. I am trying to read data from a text file which is updated regularly by another program. I only want to read the new data which will then be passed off to another device(ControlLogix 5000). The code I have thus far is below, this will read all the data, but once it reaches the end it stops. The second bit of code should send the data to the PLC. I am using VB.Net 2010 Public Class Form1 Private Sub Button1_Click(ByVal …

Member Avatar
Member Avatar
+0 forum 2

Hi this my first post here XD Its like this i have the code writen but it gives me this error Segmentation fault (core dumped) Can anyone tell me why? [code] MAX_BUFFER equ 10240 ; Constante que sera' usada como tamanho maximo de cada linha lida do teclado (10kb) FICH_ABERTURA equ 00q ; Constante que sera' usada como tipo de abertura pretendido: O_WRONLY + O_CREAT ;----------------------------------------------------------------------------- section .data fich_nome db "teste.txt", 0 ; Nome do ficheiro a abrir (em formato ASCIIZ) fich_handle dd 0 ; Variavel que vai guardar o numero (handle) do ficheiro fich_bytes dd 0 ; Variavel que …

Member Avatar
Member Avatar
+0 forum 1

Hi everyone :) This is one of my first programs using C, so I am facing some issues. our professer asked us to develop a TCP socket (client/server) where the client sends lets say an ID,Name or Major and the server searches into a txt file and returns the line(s) that contain the info. Example: If Client (user) inputs: Nouf printed to client screen: 20084, Nouf A, Computer Engineering my only problem is that the server only reads the first line. Example: If Client (user) inputs: Computer Engineering only this line is printed (returned from the search function): 20082, Noor …

Member Avatar
Member Avatar
+0 forum 1

[CODE]#include <iostream> //standard input and output #include <fstream> //file input and output #include <string> //for strings #include <exception> //catches exceptions #include <sstream> //stringstream comes from here #include <algorithm> #include <stack> #include <queue> using namespace std; bool writeFile(const string &data); //writes strings to file bool readFile(); //read file bool palin(const string &data); bool operator==(const stack<char>&, const queue<char>&); bool operator!=(const stack<char>&, const queue<char>&); void menu(); //display menu of choices int main(int argc, char *argv[]) { stack<char> *s; queue<char> *q; string input; string::iterator i; menu(); //launch menu return 0; } bool palindrome(const char word[], int size) { return equal(word, word+size/2, std::string(word, word+size).rbegin()); } …

Member Avatar
Member Avatar
+0 forum 1

The End.