Hi Team, I have an excel which has multiple rows and each row can have multiple images associated with that , which are postioned on a specific cells of that particular row.I know while we are positioning a image on top of a cell, that is not associated with the cell and it is actually floting the sheet of the workbook.My target is to read those images and at the same time mapping that image with particular cell using apche POI. I have two questions actually: 1. Is there any way to associate an image with a excel cell so …

Member Avatar
+1 forum 0

[CODE] #include <stdio.h> #include <stdlib.h> typedef struct filedata { char data[100]; }data_t; data_t * fname=NULL; //IS AN ARRAY OF the structure filedata REQUIRED HERE void quit() { printf("\nPress enter to exit"); fflush(stdin); getchar(); } int main() { char ch; fname=(data_t *)malloc(sizeof(data_t)); FILE *fptr=NULL; atexit(quit); printf("Please enter the file name to read : "); fflush(stdin); scanf("%s",fname->data); fptr=fopen(fname->data,"rb"); if(fptr == NULL) { perror("Could not open the file "); return; } printf("\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); printf("Contents of the file %s are : ",fname->data); [B] while(fread(&fname, sizeof(data_t), 1,fptr) == 1) { // what do I put here? }[/B] fclose(fptr); return 0; } [/CODE] I want to read …

Member Avatar
Member Avatar
+0 forum 11

Hello, this is a very strange problem. I had first put this discussion in the Linux and Unix thread, since I believe it is actually a problem with how the data is entered via but the vi editor, but I closed those out and will put it in the C thread, since it is being read with C code. Below is the code that is reading the data: strcpy(passw,"P7"); fscanf(fip, "%3s", ckod); /* card # 164 */ fprintf(ff16,"\n\n%12s%12s\n", "card# 164 :", "Password "); printf("passwd is %s\n", ckod); if(strcmp(passw,ckod)!=0) { printf("\n%64s\n%80s\n", "E R R O R !", "Password is incorrect. Please …

Member Avatar
Member Avatar
+0 forum 4

Hi. I'm using 3 classes: the Character class, the Scanner class, and the Test class. This is the Character class: public class Character { private char cargo = '\u0007'; private String sourceText = ""; private int sourceIndex = 0; private int lineIndex = 0; private int columnIndex = 0; public Character(String sourceText, char cargo, int sourceIndex, int lineIndex, int columnIndex) { this.sourceText = sourceText; this.cargo = cargo; this.sourceIndex = sourceIndex; this.lineIndex = lineIndex; this.columnIndex = columnIndex; } /*****************************************************************************************/ /* Returns the String representation of the Character object */ /*****************************************************************************************/ @Override public String toString() { switch (cargo) { case ' ': …

Member Avatar
Member Avatar
+0 forum 2

So I've come across a problem more than once and it'd be a ton of help if I could get this figured out! So there are several instances where I've wanted to open a file with notepad or notepad++ to change values or something (mainly with videogames). The problem that I've come across is that sometimes when I open up a file such as a .PROPERTIES or .SII extension, instead of seeing the normal text like a ton of other people are capable of seeing, mine is jumbled and encoded. For example, the file I am trying to edit "game.sii" …

Member Avatar
Member Avatar
+0 forum 3

Hi everyone, i've been searching on the internet about how to read contacts from windows live mail account and i cant see anything in the internet to solve such problem. can anyone help me with this, a pointer or tutorial for this may do. thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

I'm supposed to just read a file and display certain information. I wrote the file in notepad and have it in the correct folder for my project, but when it opens (it DOES open), it doesn't display anything. Ideas? #include <iostream> #include <fstream> using std::cout; using std::cin; using std::ifstream; int ReadData ( int ssn[], int wage[], int hours[], char status[] ); int main () { int ssn[11]; int wage[11]; int hours[11]; char status[11]; ReadData ( ssn, wage, hours, status ); return 0; } int ReadData ( int ssn[], int wage[], int hours[], char status[] ) { int num_records = 0; …

Member Avatar
Member Avatar
+0 forum 4

Hello im making this xml reader that outputs links to listbox, the xml code is like this. <item> <title>file1</title> <category>myfiles</category> <link>http://google.com</link> </item> <item> <title>file2</title> <category>myfiles</category> <link>http://yahoo.com</link> </item> My code looks like this, it works but i would like that i could click the File1 in listbox and it would work like link. now i just outputs like this. "file1myfileshttp://google.com" Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click ListBox2.Items.Clear() Dim doc As New System.Xml.XmlDocument doc.Load("http://mysite.com/myxml.xml") Dim List = doc.GetElementsByTagName("item") For Each item As System.Xml.XmlElement In List ListBox2.Items.Add(item.InnerText) Next End Sub

Member Avatar
Member Avatar
+0 forum 4

I don't know what's wrong but the succeeding strings are not properly read by fgets. else { initArray(word1); //first string fgets(word1, 29, fileIn); printf("word1: %s\n", word1); len = strlen(word1); if(word1[len-1] == '\n') word1[len-1] = '\0'; while(!feof(fileIn)) { //succeeding strings in next line initArray(word1); fgets(word1, 30, fileIn); printf("word1: %s\n", word1); len = strlen(word1); if(word1[len-1] == '\n') word1[strlen(word1)-1] = '\0'; fgetc(fileIn); } fclose(fileIn); } } texts: ABCD asnjf fkj read: ABCD snjf kj Can you give me an idea what's wrong?

Member Avatar
Member Avatar
+0 forum 4

So im making an RPG. For collision detection, I thought I would do it like this: 1. Read text file containing collision data. 2. Iterate through the list using nested for loops. 3. When a value of 1 occurs (denoting an inpassable tile) add a rectangle to list 'badTiles', where the x and y pos of the rectangle is the x and y value from the nested for loop times the tile width and height. 4. Now that all bad tiles are stored in a list of rectangles, we can check for collision. 5. In player class, perform a foreach …

Member Avatar
Member Avatar
+0 forum 9

So, Im making a game in c# using Xna. I have a function that will read a text file and display a map on screen, using numbers in the file as texture references. The file is a integer multidimensional array. I have another file which is used to set collision bounds, called collisionMap.txt. My thinking was this: 1. Read collision map file 2. If any value within the array equaly '1', then that tile will be inpassable. 3. Get x and y positions of that wile within the array. 4. These inpassable tiles will be added to another array containing …

Member Avatar
Member Avatar
+0 forum 2

I need help reading a bool function from my HW assignment, I am not asking you to do complete my assignment for me. All I need help with is reading my bool function in main. Thank you for looking #include<iostream> #include<fstream> #include<string> using namespace std; struct StudentType {string studentName; int testScore;//Between 0 and 100 char grade; }; void PrintNameHeader(ostream& out); bool OpenInputFile(ifstream& inFile, string& infilename ); void Pause(); void ReadStudentData(ifstream& infile, StudentType student[], int& ); void AssignGrades(StudentType student[], int); int HighestScore(const StudentType student[], int ); void PrintNamesWithHighestScore(const StudentType student[], int); void DisplayAllStudents(const StudentType student[], int); void GetLowHighRangeValues(int& , int&); void …

Member Avatar
Member Avatar
+0 forum 5

This is my program for a notepad! I am getting error at the part where I'm trying to extract the text from another .txt file!! I used the method realLine() but it only reads one line!! I want to know what other methods can I use here to extract the entire content!! import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; class MenuDemo extends JFrame implements ActionListener { Container con= getContentPane(); JMenuBar bar = new JMenuBar(); JMenu file = new JMenu("File"); JMenu edit = new JMenu("Edit"); JMenu format = new JMenu("Format"); JMenu view = new JMenu("View"); JMenu help = new JMenu("Help"); …

Member Avatar
Member Avatar
+0 forum 6

Hello, I'm having a little trouble with a some code that I'm writing for homework. Basically, I'm taking two files that contain numbers and merging the contents into another file. The files do not have the same amount of numbers in them (one might contain 7 while the other contains 10) and the numbers are sorted from small to large in each file al ready. My problem is that not all the numbers are being written to the output file. Here is the code below: #include <iostream> #include <fstream> using namespace std; void MergeFiles(ifstream&, ifstream&, ofstream&); int main() { ifstream …

Member Avatar
Member Avatar
+0 forum 3

3 years ago, one brother solved this problem, i need this program to make some calculation. actually, i have some fractional/decimal component t (like 2.0213, 3.047) this program can only take integer. Can anybody please help me !!! #include<iostream> #include<fstream> #include<string> #include<cstdlib> #include<cmath> #include<iomanip> #include <windows.h> using namespace std; //void calculateAverage(); //int calculateGrade(); //void updateFrequency(); int main() { const int size=25; int debug=size; int test1[size], test2[size]; ifstream infile; for(int i=0;i<size;i++) { test1[i]=0; test2[i]=0; } cout<<"Reading from file ''input.txt''..."<<endl; infile.open("input.txt"); while(size==debug) { for(int i=0;i<size;i++) { infile>>test1[i]; infile>>test2[i]; } debug--; } for(int i=0;i<size;i++) { cout<<test1[i]<<" "<<test2[i]<<" "<<endl; } infile.close(); system("pause"); return 0; …

Member Avatar
Member Avatar
+0 forum 6

I got this snippet of code from a larger program I've been writing and I'm stuck. All I'm trying to do is read from a file line by line but I keep picking up the new line character, at least that's what I think it is. #include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { FILE *file = fopen(argv[1], "r"); char buff[128]; while(fgets(buff, sizeof(buff), file) != NULL) { printf("%s\n",buff); } } Ultimately I want to be able to compare the strings I get from splitting the line. This is my output from a .txt file: mangle devoid devoid systems …

Member Avatar
Member Avatar
+0 forum 3

Hello! I'm new here, and I need some help. :) I am working on a program that has to write and read a binary file. I have to add lectures to it, they look like: **COURSECODE;COURSENAME;MAXAPPLICANTS;ACTUALAPPLICANTS;** I could write that in a file without any problems using `char*`. My question is: how do I read that back in a struct if the records are non-fixed size? (e.g.: coursename can be Linear Algebra or Analysis -> length is non-determined) I also need to modify the actual applicants number, how do I find the character position of it, and the current line? …

Member Avatar
Member Avatar
+0 forum 7

I am trying to read a structure from a .dat file...the first integer to be read is the no of readings, then there is the data in following structure format struct Oven { int rec_no; int temp; int status; char string[10]; }; below is the method through which I read the file int read_and_process_file() { int counter; FILE *ptr_myfile; FILE *ptr_myfile2; struct Oven my_record,my_record2; ptr_myfile=fopen("data.dat","rb"); ptr_myfile2=fopen("out.csv","w+"); if (!ptr_myfile) { printf("Unable to open file!"); return 1; } fread(&no_of_readings,sizeof(no_of_readings),1,ptr_myfile); int value=10; unsigned char x; for ( counter=1; counter <= 2570; counter++) { int size = fread(&my_record,sizeof(struct Oven),1,ptr_myfile); if (size != 1) { …

Member Avatar
Member Avatar
+0 forum 3

Hello everyone, i am fairly new to shell scripting so please bear with me. The following script is supposed to read words from a file and depending on the word print different things. However it always prints the default value. It also refuses to work completely if the first line in 'numbers.txt' is not a blank line. I would be grateful for any hints whatsoever. script #!/bin/bash file="numbers.txt" while read line do operator=`awk '{print $1}' $line` case $operator in "divide") echo "/";; "multiply") echo "x";; "add") echo "+";; "subtract") echo "-";; *) echo "default";; esac done < "$file" numbers.txt (the …

Member Avatar
Member Avatar
+0 forum 5

Im reading a text file and storing the characters in an array. I get a "Unhandled exception at 0x0109985e in Executable.exe: 0xC0000005: Access violation writing location 0xcccccccc." void drawMap(string MapLoc) { int i = 0; int x = 0; int y = 0; char* arrayMap[5225]; ifstream mapReader; mapReader.open(MapLoc); for (i = 0; i <= 5225; i++) { while (mapReader.good()) { * mapReader >> arrayMap[i]; } } mapReader.close(); for (i = 0; i = 5225; i--) { if ((i = 96) || (i = 191) || (i = 286) || (i = 381) || (i = 476) || (i = 571) …

Member Avatar
Member Avatar
+0 forum 20

void drawMap(std::string MapLoc) { char* gridMap[95] [55]; ifstream Map(MapLoc, ifstream::in, ifstream::binary); while (Map.good()) { for(int i = 0; i < 95; i++) { for(int j = 0; j < 55; j++) { if (gridMap[i] [j] == "X") { //Draw Wall glColor4ub(255,255,255,255); glBegin(GL_QUADS); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glEnd(); } else if (gridMap[i] [j] == ".") { //Draw Space glColor4ub(0,0,0,255); glBegin(GL_QUADS); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glEnd(); } else if (gridMap[i] [j] == "C") { //Draw Char } else if (gridMap[i] [j] == "O") { //Draw Opponent } } } } Map.close(); } I need to read characters from a text file into …

Member Avatar
Member Avatar
+0 forum 5

Hello guys! I need some help... I'm new in Java programming and I'm dealing with in issue. I'm at a step of my project that keeps stoping me from going further. I have some xml files that contains diacritics and I need to read them and extract the tag's that I need. Here's an example of my xml files: <?xml version='1.0'?> <entry> <word>VAGABONDAJ</word> <pos>s. n. </pos> <year>1837</year> <etim> fr. vagabondage, it. vagabondaggio. </etim> </entry> From this I extracted the <word>, the <year> and the most important <etim> (I did this with REGEX). If a word has french etymology or italian …

Member Avatar
Member Avatar
+0 forum 1

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

hi, if anyone can help me? I have problem with windows live mail. the preview pane show different email with the selected email I click in message list pane. It is not happened to all the message but some do. this is happened just recently, I didnt have this problem before (or I think it is, hard to check it since I receive hundreds emails every day and I distributed it to many folders). Thanks.

Member Avatar
+0 forum 0

Gents as you can see I have done great progress in getting the last line and the line beforelast working and spliting but I am stuck now as I need to the beforethat (3rd) line from last also included and I can't figure it out, everything i do fails to compile or fails to run. Any suggestions? Scanner scanner = new Scanner(new File(resultfile)); String last = null; String beforelast = null; String beforethat = null; while (scanner.hasNextLine()) { beforelast = last; last = scanner.nextLine(); } String arr[] = last.split(","); RecordID1.setText(arr[0]); RecordID2.setText(arr[1]); RecordID3.setText(arr[2]); RecordID4.setText(arr[3]); RecordID5.setText(arr[4]); String arg[] = beforelast.split(","); RecordID6.setText(arg[0]); RecordID7.setText(arg[1]); …

Member Avatar
Member Avatar
+0 forum 1

Hi I read a text file using PHP, the file gets uplaoded, and what I want to do is read the file take some information out of it and post it to mysql. Problem is that when reading the file it removes the spaces, I cannot count where the data is as addresses and names in the text file are not the same length. Code to read the file: <?php $data = file_get_contents("tmp/file1.txt"); //read the file $convert = explode("\n", $data); //create array separate by new line for ($i=0;$i<count($convert);$i++) { echo $convert[$i].', '; //write value by index } ?> The process …

Member Avatar
Member Avatar
+0 forum 6

Hi There, I need to re-write any mention of .tellg() in my code as the function is not supported on the desired hardware. I have the following lines of code: getline(file,line); { std::istringstream stream(line); stream >> first >> second >> third >> forth; UINT32 file_pos = stream.tellg(); file_pos++; fifth = line.substr( file_pos , line.length() - stream.tellg() ); } As far as I can work out, tellg is used to find out where in the line the stream is, so fifth is anything between forth and the end of line. file_pos++; is to allow for a space. My questions are: Is …

Member Avatar
Member Avatar
+0 forum 4

Hello everyone I'm having a bit of trouble with C. Its been awhile and I was wondering if I'm on the right track I'm trying to read from a file and manipulate the data with a structure I created. The problem is the first two values in the text document will be used for the loop count and the next will be used to subtract from other values in the document. For instance the first value is 10 so go through 10 lines of the document and the next line is the date 20120803. I want to read these two …

Member Avatar
Member Avatar
+0 forum 7

i am getting weird result here. if condition at line 25 is satisfied only 4 times while reading cpuinfo but **cores** is modified each time while loop iterates. i am not able to think of anything that may cause this. any help of any sort is appreciated. #include <stdio.h> #include <string.h> #include <assert.h> int main() { char *a="9"; char *b="0"; if(strcmp(a,b)>0) printf("started \n"); int cpu=0,flag=0,count=0; char str1[200],s[100],s2[100],c; char *ss,*cores,*model,*physid,*prevphysid,*siblings,*ss1,*ss2,*ss3,*ss4; FILE *fp; fp=fopen("/proc/cpuinfo","r"); if(fp) { while(fgets(str1,200,fp)!=NULL) { ss=strtok(str1,":"); printf("ss is %s \n",ss); if((strncmp("cpu cores",ss,9)==0)&&count==0) { printf("rue \n"); ss1=strtok(NULL,":\t "); cores=ss1; printf("ss is %s hi \n",ss); //cores=ss; printf("in loop cores is %s …

Member Avatar
Member Avatar
+0 forum 5

evrything was fine until i inserted 100 to 125 lines in code. i am wondering what kv is doing wrong as it is not even printing that version file was opened.. any sort of help is appreciated. files included in the code are given below for reference. proc/version file: ** Linux version 2.6.38-15-generic (buildd@panlong) (gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) ) #65-Ubuntu SMP Thu Jul 26 20:16:13 UTC 2012** #include <stdio.h> #include <string.h> #include <assert.h> int main() { char *a="9"; char *b="0"; if(strcmp(a,b)>0) printf("started \n"); int cpu=0,flag=0,count=0,core,siblings,physid=-1,prevphysid,bat,seal=0; char str1[200],model[100],version[1000]; char *ss; FILE *fp,*kv; fp=fopen("/proc/cpuinfo","r"); if(fp) { while(fgets(str1,200,fp)!=NULL) { if(seal==0) { if(strstr(str1," …

Member Avatar
Member Avatar
+0 forum 3

The End.