Click here to Skip to main content
15,896,359 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help for CStdioFile Read mode Pin
Naveen21-Oct-09 20:24
Naveen21-Oct-09 20:24 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 21:48
Nicholas Amh21-Oct-09 21:48 
GeneralRe: Need help for CStdioFile Read mode Pin
Richard MacCutchan21-Oct-09 23:18
mveRichard MacCutchan21-Oct-09 23:18 
AnswerRe: Need help for CStdioFile Read mode Pin
theCPkid21-Oct-09 19:42
theCPkid21-Oct-09 19:42 
GeneralRe: Need help for CStdioFile Read mode Pin
Nicholas Amh21-Oct-09 20:24
Nicholas Amh21-Oct-09 20:24 
GeneralRe: Need help for CStdioFile Read mode Pin
theCPkid22-Oct-09 0:22
theCPkid22-Oct-09 0:22 
QuestionRe: Need help for CStdioFile Read mode Pin
David Crow22-Oct-09 3:25
David Crow22-Oct-09 3:25 
QuestionRead from text file Pin
sonualex21-Oct-09 19:05
sonualex21-Oct-09 19:05 
Hi all ..

I am trying to make an exe which will save the data entered by user in a text format.
Its also possible to import the text file to the editbox.. I have four editboxes and these four will be having different data.. but once i store it in text format it will be in one file and during importing the complete data will be in all four edit boxes..
I want to filter out the data for specific editboxes while importing.. Editboxes are Critical, Important, Less Important and Normal.....
Can snybody help me how to filter out the specific data...

iam including my code here.. also my text format...plz hav a look and guide me...
thanku so much


void CNoteDlg::OnOpen()

{
FILE * pFile;

CFile flEdit;
char strFilter[] = { "Text Files (*.txt)|*.txt|*.txt (*.*)|*.*||" };

CFileDialog FileDlg(TRUE, ".txt", "Prioritynotes",OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
strFilter,NULL);

if( FileDlg.DoModal() == IDOK )

{

char c;

CString mystring;


pFile = fopen ("D:\\Prioritynotes.txt" , "r");

if (pFile == NULL) perror ("Error opening file");

else
{
while (!feof(pFile))

{
c = fgetc (pFile);

mystring+= c;

if (c=='\n')

{

mystring.TrimRight();
char d[3];

d[0] = 0x0D;
d[1]= 0x0A;
d[2]= 00;
mystring+= d;
m_sedit1 = mystring;

m_sedit2 = mystring;

m_sedit3 = mystring;

m_sedit4 = mystring;

UpdateData(FALSE);


}

}
}
}
}



my format of text file

Date
21/10/2009
Time
4:05:41 PM
**********************

Critical****
--------------------------


Important***
--------------------------


Less Important**
--------------------------


Normal*
--------------------------
AnswerRe: Read from text file Pin
theCPkid21-Oct-09 19:26
theCPkid21-Oct-09 19:26 
GeneralRe: Read from text file Pin
sonualex21-Oct-09 20:32
sonualex21-Oct-09 20:32 
GeneralRe: Read from text file Pin
theCPkid22-Oct-09 0:25
theCPkid22-Oct-09 0:25 
QuestionRe: Read from text file Pin
David Crow22-Oct-09 3:34
David Crow22-Oct-09 3:34 
AnswerRe: Read from text file Pin
sonualex26-Oct-09 20:21
sonualex26-Oct-09 20:21 
QuestionRe: Read from text file Pin
David Crow27-Oct-09 2:59
David Crow27-Oct-09 2:59 
AnswerRe: Read from text file Pin
sonualex27-Oct-09 3:05
sonualex27-Oct-09 3:05 
GeneralRe: Read from text file Pin
David Crow27-Oct-09 3:28
David Crow27-Oct-09 3:28 
GeneralRe: Read from text file Pin
sonualex27-Oct-09 20:29
sonualex27-Oct-09 20:29 
QuestionRe: Read from text file Pin
David Crow28-Oct-09 3:45
David Crow28-Oct-09 3:45 
AnswerRe: Read from text file Pin
sonualex28-Oct-09 23:22
sonualex28-Oct-09 23:22 
GeneralRe: Read from text file Pin
David Crow29-Oct-09 2:20
David Crow29-Oct-09 2:20 
GeneralRe: Read from text file Pin
sonualex30-Oct-09 1:01
sonualex30-Oct-09 1:01 
Question#include problem Pin
kk.tvm21-Oct-09 18:30
kk.tvm21-Oct-09 18:30 
AnswerRe: #include problem Pin
«_Superman_»21-Oct-09 18:41
professional«_Superman_»21-Oct-09 18:41 
AnswerRe: #include problem Pin
Naveen21-Oct-09 18:50
Naveen21-Oct-09 18:50 
QuestionHow can set focus on Button in FormView? Pin
Le@rner21-Oct-09 18:27
Le@rner21-Oct-09 18:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.