C :: Program To Show Large Text File In Parts

Jan 1, 2014

I am currently working out on a problem in which a c program is to be made which shows a large text file in parts.
f
For example: If file contains 200 lines. 50 lines will be shown on first page and user is asked to press any key to move to next page until EOF is found. user is allowed to return to previous page as well, and this is very complicated task for me. I tried to move cursor to a specific position using fseek etc but it page doesn't stop and reaches to end quickly.

View 1 Replies


ADVERTISEMENT

C :: Program That Takes A Large Text File As Input

Nov 7, 2014

I am writing a spell checker for a exercise for a class I am taking online. I have to load a huge text file of 143092 words into a hash table.

The program segfaults on word number 63197. Is there a way to debug this in gdb without having to step threw the function 63197 times.

View 3 Replies View Related

C++ :: Parsing Large Text File

Feb 10, 2013

I have a massive text file containing many thousands of directory and file names with / at the root, like so:

/dir/
/dir/dir/
/dir/dir/dir/
/file
/dir/file
/dir/dir/file
/dir/dir/dir/file

I need to parse the file in such a way that I can create a filesystem hierarchy as if I were enumerating files/directories. Ultimately I want to add these to a tree gui control with everything under its proper node without duplicating anything. It should look roughly like so:

dir
-file
-dir
-file
-dir
-file

I can open the file and add nodes/children to the tree control but how should I go about doing the actual parsing? How can I find a filename and say "this belongs under this node"? I want to do this efficient as possible even if I must use multiple threads.

View 1 Replies View Related

C++ :: Show Large ASCII On Screen?

Aug 26, 2013

I've written a Hexadecimal/ASCII chart, and would like to be able to show a larger version of the selected ASCII on screen. Is there a way to read the individual lines of bytes that make up a letter/symbol/number to show on screen.

|0|0|0|0|0|0|0|0| = 0
|0|1|0|0|0|0|1|0| = 66 O O ( These 'O' represent ASCII 219 )
|0|0|1|0|0|1|0|0| = 36 O O
|0|0|0|1|1|0|0|0| = 24 OO
|0|0|0|1|1|0|0|0| = 24 OO
|0|0|1|0|0|1|0|0| = 36 O O
|0|1|0|0|0|0|1|0| = 66 O O
|0|0|0|0|0|0|0|0| = 0

To make a large graphic X.

I'm using Microsoft 2012 Express, in the console. I don't feel comfortable yet programming in Windows mode.

View 10 Replies View Related

C++ :: Basic Parts Of Text Based RPGs?

Oct 22, 2013

How you'd type yes or no scenarios for a text based RPG? And I mean a really basic like 'you see ..... what do you do?'. Also, how would you finish a code like this.

View 9 Replies View Related

C :: Possible To Split Command Console Into 2 Parts - Visual And Text Area

Feb 1, 2015

I have had experience in programming from python (slightly related, html/css) and the computercraft from minecraff (basic i think it is).

My question is mainly about the C and past experience with the computercraft.

1. Is it possible to split the command console into 2 parts (a visual area and a text area)
2. Is it possible to use any form of pixel art or custom characters within any command console using C.

View 2 Replies View Related

C :: Read Text From A File And Show What Words Occur How Many Times

Apr 21, 2013

I'm trying to make program that will read text from a file and show what words occur how many times. I'm trying to make it so that if a new string comes, it saves it into wlist[], and counts 1 to wcount[]. If the same word is there, it will just add 1 to wcount[]. The program will end when it gets to the end of a file.

I don't know the reason, but I can't get strcmp and strcpy to work. I had to put a pointer in curword, just to make it compile.

Code:
#include <stdio.h>
#include <string.h>
#define LIST_MAX 100
#define WORD_MAX 20
int main(){

[Code] ....

View 6 Replies View Related

C/C++ :: Program That Opens Text File And Checks Usernames Listed In Text Files?

Jun 5, 2014

I want to make a program that opens a text file and checks the usernames listed in the text files to see if the names are registered on a site such as twitter. How easy would this be to make, what things would I need to know?

View 4 Replies View Related

C# :: Loading Large Text Files In A RichTextBox (OutOfMemoryException)

Mar 31, 2014

I am creating a simple log parser (loads a text file and filters out unnecessary information, but has the option to show the full log) and I'm running into an issue with fairly large log sizes (50+mgs). I have seen a few recommendations from a stream to memory manged files and even alternate 3rd party controls.

I foresee a few issues with any of the non-third party solutions (which I would prefer to avoid third-party add-ins) such as the scroll bar not correctly reporting the relative length or position of the complete text in the box (when displaying only a portion of the file at a time) and in the stream solution where you read on scroll (as necessary) have not only the same issues, but how do you resume reading in the middle of the file? This also all assumes I would be periodically clearing the RichTextBox to keep the memory usage down to avoid an OutOfMemoryException (which I have been running into.)

View 14 Replies View Related

Visual C++ :: Show Some Rich Text In A Dialog Box?

Nov 26, 2012

I have been told to show some text document when our application starts up, it is an EULA. They gave me a word file and I saved this file in a .rtf format. I then wish to show this in a dialog box and found this on code guru: [URL]

Which seems to be a sub-class that will do all the formatting for me. So I use that class and then load in the .rtf file, using their setRTF method I just get an empty text box.

I just want to be able to show this formatted, somewhat pretty text from this document in my application as close as I can to the original document. Is there an easy way to do that? I could turn it into plain text, but I think that my boss would not be happy about that.

The problem was that I needed the text box to be marked multi-line.

View 1 Replies View Related

C Sharp :: Show Results From Values In Text Boxes On Clicking Or Pressing Tab Button

Feb 21, 2013

I am developing application software.entering two textbox value,while click or pressing tab button in third textbox, the result needs to show in third textbox.

View 1 Replies View Related

C++ :: Possible To Use Extremely Large Integers In Program?

Mar 23, 2013

Would it be possible (and how) to use extremely large integers in a C++ program (such as 20 million digits)?

View 7 Replies View Related

C :: Program That Multiply Very Large Numbers (out Of Range Of Long Int)

Jan 10, 2014

I have to write a program, that multplicates very large numbers (out of range of long int). It's said that i need to use arrays and read the numbers as strings. My problem is to end function called "mnoz:, because i don't know how to sum the multiplicated values of arrays a and b.

Code:
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include "winbgi2.h"
#include<string.h>
#define roz 10000
char lan(char a[])

[Code] ......

View 1 Replies View Related

C/C++ :: USB To Text File Program?

Jul 7, 2014

I have been tasked to interface an old piece of equipment at our facility with a laptop in the same room. The laptop is to read the data input through USB and print to a text file. The equipment uses an RS485 serial output. Is this possible to do in C++?

View 5 Replies View Related

C/C++ :: Add Text File To Program On Mac

Apr 22, 2014

How to add text files to use in Xcode programming? I have tried to add them with no success. Is there some code I need to add to make the program read the text file?

View 7 Replies View Related

Visual C++ :: Program Creates A Large Pointer Array Of Numbers

Feb 22, 2013

I am working on a program which creates a large pointer array of numbers and then performs several iterations of operations in them.

Code:
int * u = new int[N];
double * nu = new double[N];
int * nud = new int[N];
for (int i=0;i<M;i++){
for (int i=0;i<N;i++){
u[i]=0;
nu[i]=0;

[Code]...

If M is small enough then there are no problems in the program. However once M is large enough I get the "unhanded exception":

std::bad_alloc at memory location 0x0026f728..

Since I am just reusing the same arrays, and since I am able to make it through a few iterations, I didn't think it could be a memory issue. If it is, is there a way I can clear the data completely after each iteration?

View 4 Replies View Related

C :: Program To Append Text To TXT File

Mar 16, 2013

I am trying to understand how to append some code to a text file. I have run a simple program like the one below. Basically it opens a text file and then it appends the string aaaaaaaaaa

Code:
#include <stdio.h>
#include <io.h>
#include <stdlib.h>
char s[10] = {"
aaaaaaaaaa"};

[Code] .....

Now that I know how to append the above string, I now would like to extend the experiment to append the following snipped of code in my test.txt file:

Code:
<Placemark>
<name>12:01</name>
<Snippet maxLines="0"></Snippet>
<description>&nbsp;</description>

[Code] ....

How do I go about doing this? The problem I am experiencing is that all the / and " characters in the above snippet of code seems to get the C compiler confused. One thought I had was to create a string like the one below but as I mentioned, the number 0 in the code is surrpunded by " " and this confuses the compiler:

Code:
char s[250] = {"<Placemark>
<name>12:01</name>
<Snippet maxLines="0"></Snippet>

[Code] ....

View 3 Replies View Related

C :: Program With Integers And A Text File

Oct 6, 2014

I created a program in C that opens a text file and read integers.

File `numbers.txt`:
> 5 6 4 6 3 4 1

I use some restrictions with the `fscanf()` library and read the file, just for the record, and if everything goes fine I proceed to the next part of code (I know I could use `fget()`, but this is how I done it).The next part of the code will be this:

- First, I want the program to read the numbers from right to left. I look for an answer in google and many C courses, but I couldn't find a working solution. I think that the code is pretty simple, though I can't find it. **To be clear for the next part, we read the numbers from right to left.**

- Then, this is the hard part for me: I want the program to read the numbers and if the next number is higher (**not equal**) than the last one to keep it in memory, **only if it's higher than the last.** This can be continue for **1 through 500.000 numbers.**

- Then when the procedure done, I want to print how many numbers are greater than the last one and save it to a file, which I can do it if I solve the last problem.

We have the below numbers:
5 6 4 6 3 4 1

The program starts to read the numbers from right to left.Now which and how many numbers are greater than the last one?

The answer is 3 numbers:
5 6 4 [6] 3 [4] [1]

Then the program will print the number 3 with a message and save it to a file called `xxx.txt`. I am posting the `main` code, not all the code just what you need to solve the problem:

Code:

#include <errno.h> // macros for reporting and retrieving error conditions
#include <stdio.h> // load main C library function
#include <stdlib.h> // need that for many reasons ;)
#include <string.h> // loads various of characters functions
}

[code]....

In conclusion, I want 2 pieces of code:

- One to read the numbers from right to left
- One to make the above procedure

View 11 Replies View Related

C++ :: Reading Encrypted Text File In Program?

Oct 3, 2013

I need to decrypt my text file and make it able to read in my program..

What I have programmed so far is to read the encrypted file, create a new file, decrypt it and read the newly created file..

I need to decrypt the encrypted file without having to create a new file that reads the decrypted text..

Well, Let me show you my code:

P.S Most of the include is not needed and I already know that Visual studio 2010 Windows Form Application CLR

Code:
#pragma once
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <conio.h>

[Code].....

You have my decryption code and the code I want to use..

I have uploaded the code for you to use on your computer because it is fairly hard for me to explain..

I want to be able to read the encrypted file in my program, without having to writing a new file to decrypt it..

Decrypted & Encrypted .txt file Included (And images)

--> Program .rar pack link <--

Build it with Visual Studio 2010

View 5 Replies View Related

C :: Program That Deletes Same Lines In A Text File

Mar 23, 2013

I am working on a program that deletes same lines in a text file. I already wrote it, but it still doesn't work.

Code:
#include <stdio.h>
main(){
FILE *f1,*f2;
char oneword[100],filename[25];
int c;
long int i,j;
char *norstring[500000]; /* I count from 1 */

[Code] ....

View 3 Replies View Related

C++ :: Program Won't Output Any Information To Text File

May 6, 2013

my program wont output any information to the text file that I have specified it just creates it but it leaves it blank

#include <iostream>
#include<string>
#include<iomanip>
#include <fstream>
using namespace std;
class Carloan

[code]....

View 2 Replies View Related

C++ :: Getting Thumbnails (with Large Icons) Of Folder Not File

Nov 5, 2014

I am searching an API that can give me thumbnail(with large Icons) of all folders of all drive in Windows 7. Like

c:/--->Folder1,Folder2.....FolderN
d:/--->Folder1,Folder2.....FolderN
.
.
n:/--->Folder1,Folder2.....FolderN

How i can get associate thumbnail(with large Icons) of each folders of any of the drive.

View 5 Replies View Related

C++ :: Finding Char Array In A Large File

Feb 21, 2015

I have a specific byte (that is unsigned char) array, that I need to find in a very big file (2GB or so), currently I'm using:

size_t fsFind(FILE* device, byte* data, size_t size) {
int SIZE = (1024 > size) ? 1024 : size;
byte buffer[SIZE];
int pos = 0;
int loc = ftell(device);

[Code] ....

Which seems to find proper result on first use, but on subsequent searches it seems to find invalid positions, is there something I'm doing wrong, or is there a better way?

View 6 Replies View Related

C++ :: Parsing A Large File Into Smaller Units

Dec 16, 2013

I have a large binary file (84GB) that needs to be broken down into smaller file sizes (~1GB to 8GB) for analysis. The binary file is on a 32-bit machine and cannot be copied to another machine for analysis. The PC has Visual Studio 6.0 and is not upgradable. My issue is I'm using the following generic code to create the smaller files.

fseek(file, start, SEEK_SET);
end = start + (variable based on file size);
fseek(file, end, SEEK_SET);
for (i=start; i<end; i++) {
if(!feof(f)) {
byte = fgetc(f);
fputc(byte,new_file);
}
}

However, on a 32-bit machine, the iterator can only count up to ~2billion. Which means that I'm unable to copy anything past ~2GB. My original idea was to delete from the large binary file as I read from it so that I can reset the iterator on every read. However, I haven't come across a way to delete binary file entries.

Is there any other way that to break down a large binary file into smaller units? Or is there a way to delete binary file entries in sections or per entry?

On a 64-bit machine I could use _fseeki64. I've been reading that some versions of Visual 6.0 are capable of supporting 64-bit numbers but when using _fseeki64 or _lseeki64 on this machine its an "undeclared identifier"

View 7 Replies View Related

C/C++ :: Finding Optimized Parts By Length?

Feb 4, 2015

I am trying to put together a parts ordering calculator for work, and I am trying to figure out what the best to get what parts to order based on the length of the unit and the length of the parts.

So for example I have a counter that is 600 inches long, and I have 3 type of railings that we would use. The first one is 17 inches, the next one is 14 inches and the last one is 11 inches.

The idea is figuring out how many ( Combination of the 3 ) of the 17, 14 or 11 inch railings does would it take to meet the 600 inches. If it ends up going over, then we can cut it size, but I want to get as close as possible.

So in this situation if the counter is 634 inches, then we would order:

35x 17"
2x 14"
1x 11"

So I would have to write an algorithm i guess to get the best combination of the 3 length of railing to fit the counter with as little excess as possible.

View 3 Replies View Related

C :: Program To Read In A Tab Deliminated Text File Of Xyz Coordinates

Nov 14, 2013

I have been working on a program to read in a tab deliminated text file of xyz coordinates of atoms/particles and store the values in three seperate arrays. This is my code so far:

Code:

#include<stdio.h>
#include<stdlib.h>
void fileinput(FILE *ifp) {
int N, column, atom;
int c;
column = 1;

[Code]...

Supposedly this should assign the values in the text file to the cooresponding arrays but when I run the code on a simple test file all I get is:

Code:

$ ./input.o -i ./test.txt
Atom one coodinates x 0.000000, y 0.000000, and z 0.000000 Where test.txt is: Code: 1.0000 2.000 1.5
3.0000 5.000 1.4
4.0000 3.000 1.3

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved