Go to the begining of the txt file after using getline()

Go to the begining of the txt file after using getline()

I use fstream, open() and getline() to take a whole line from the text file.
I would like to know how I can set the value of the file pointer to the 
beginning of the file without closing (with close() ) to start using 
getline() again.
I need to do it many times and I think that making that without closing and 
reopening file thousands times will save much time.
Could you advise me.
Alur

0
Alur (22)
2/15/2005 4:25:05 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
525 Views

Similar Articles

[PageSpeed] 15

fseek(fileptr,0,SEEK_SET);

AliR.

"Alur" <Alur@discussions.microsoft.com> wrote in message
news:CD7B7AFF-6057-4C37-955A-CADA73781B36@microsoft.com...
> Go to the begining of the txt file after using getline()
>
> I use fstream, open() and getline() to take a whole line from the text
file.
> I would like to know how I can set the value of the file pointer to the
> beginning of the file without closing (with close() ) to start using
> getline() again.
> I need to do it many times and I think that making that without closing
and
> reopening file thousands times will save much time.
> Could you advise me.
> Alur
>


0
AliR1 (391)
2/15/2005 6:26:12 PM
Reply:

Similar Artilces:

Merging 2 files
Hi all, I have 2 workbooks that are similar to the structure below. Workbook 1 Workbook 2 ColA Col B ColC || ColA Col B ColC A Desciption of A 1 || A Desciptio of A 3 B Desciption of B 2 || C Desciptio of C 2 C Desciption of C 1 || D Desciptio of D 3 Is there any way that I can combine the two of these to resemble th following. ColA Col B ColC ColD A Descip...

how do I change a pub file so i can read it
I just got a new computer and several of my business cards and certificates I saved are in Pub files and I cannot open them. How do I convert them? Can someone help??? please!! Have you installed the Publisher application? Are you getting an error? What does the error say when you click details? -- Mary Sauer http://msauer.mvps.org/ "Randy C." <Randy C.@discussions.microsoft.com> wrote in message news:1076DCB5-4BA0-456E-A69D-C09FCF288652@microsoft.com... >I just got a new computer and several of my business cards and certificates >I > saved a...

Database maintenance -- Checkdb, dbreindex, stats use sequence?
I have some specific questions about checkdb that I would appreciate if you can give me some guidelines. Thank you for your time. a) Is dbcc checkdb to be used before or after that backup is made? If it is before, should the backup be called off if there are any errors in Checkdb? How does SQL agent handles this if called as a seperate step? b) What errors can you repair safely and what not? When would you say restore is the best way to go? Is that always do a repair before going for a restore? c) When do you do dbrendiex? After checkdb, backup, dbreindex? Is stats update nec...

Email File [WILDPACKET]
This file I need to e-mail daily, is there a quick and easy way I can configure this it to be sent out daily w/o any intervention???? Thanks in advance. On Tue, 25 Oct 2005 08:46:04 -0700, "WILDPACKET" <WILDPACKET@discussions.microsoft.com> wrote: >This file I need to e-mail daily, is there a quick and easy way I can >configure this it to be sent out daily w/o any intervention???? > >Thanks in advance. Er, what file would this be? What application is doing that sending? Thank you Mark for your reply. This file is on a server and it's a .CSV file. I don...

creating a file of particular extension
hello friends, i am using ms access 2003, vb6. i want to create a file of extension ".gms" . how can i do this? how can we create a file of particular extension? thanq ...

HELP! Money Files and Backup files lost!!
I had a computer guy work on my computer and asked him to consolidate folders because we had folders all over the place and I wanted them all in a centralized location. As a result, Money can't find my files. I tried doing a search for *.mbf & *.mny files to no avail. The files that show up are EMPTY!! AND as luck would have it, BOTH my backup floppies are corrupt!! Can anyone help me find my files? The computer guy insists that he deleted nothing. I'm using Microsoft Money 2001. Any help would be GREATLY appreciated as we're talking about 8 years of finanacial d...

Converting Date to Beginning of the Month
Hello All, I have an issue with dates. I am trying to convert any date such as 11/27/2006, 3/14/2005, to essentially only the month and year. I have a formula that will only work correctly if all dates are the first of the month so I need to convert the above dates to this: 11/1/2006 and 3/1/2005. Is there a way to do this? Any help would be greatly appreciated! Thanks Try this: =Date-DAY(Date)+1 A1 = 11/27/2006 =A1-DAY(A1)+1 = 11/1/2006 Biff <carlsondaniel@gmail.com> wrote in message news:1164840724.358071.298260@j72g2000cwa.googlegroups.com... > Hello All, > > I h...

How can I customise colours used in charts and keep those colours.
Hi I've produced a series of pie charts from a set of data - and have customised the colours but I have to manually alter the colours on each chart once I've made the chart. How can I keep the colours for each chart? Under Tools - Options - Color, you can set what XL should use by default as the chart colors. -- Best Regards, Luke M "LJ" <LJ@discussions.microsoft.com> wrote in message news:D25D55A4-02F8-46CE-81A4-D84EE5C9B7B7@microsoft.com... > Hi I've produced a series of pie charts from a set of data - and have > customised the colours b...

problem using the newest platform SDK in MFC
i'm just begin learning SDK. how can i use the latest SDK's *.h and *.lib files in vc6? for example, in a MFC Appwizard creating dialog based project, i added these lines: #include <Winuser.h> #include <commctrl.h> ...... INITCOMMONCONTROLSEX icc; icc.dwSize = sizeof(INITCOMMONCONTROLSEX); icc.dwICC = ICC_WIN95_CLASSES;//ICC_STANDARD_CLASSES; InitCommonControlsEx(&icc); why InitCommonControlsEx return 1 and when i changed icc.dwICC to ICC_STANDARD_CLASSES, compile is faild? i have added the ComCtl32.Lib file in project settings, and added "_WIN32_WINNT=0x0501&q...

Find the original creator of an Excel file
There are a few mysterious Excel files in my network folder. I think it's accidentally dropped by someone on the network. I thought you can find the original creator's name based on the name of copy Excel was registered to. Where do I find that information? Thanks! File>properties -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "cpliu" <spamfreeliu@yahoo.com> wrote in message news:a457d0b5-1925-4c3c-abd9-4dd288cd2e31@e53g2000hsa.googlegroups.com... > There are a few mysterious Excel files in my network folder. I think > it...

Setting up Outlook from the beginning.
I'm a little confused about outlook setup, I've only just worked in outlook through my employer and have never had to set up outlook at home and use it, I've always just used yahoo. Now for my business at home I want to use Outlook for my email and organize reminders and schedules etc, however I don't understand how you end up w/ an email address in outlook, like I said before mine through my work was always my name@the name of my employer.com. Then I was told outlook could link to my yahoo email address but that I also do not know how to do. Can anyone give me advice...

OE unsafe file attachement message
Each time I send an e-mail with an attachment there is a message stating the following: "OE removed access to the following unsafe file attachments". I was able to discover this by looking in my sent items folder and pulling up each individual e-mail. However, I did a test and sent to some people they did receive the e-mail and attachments. Any idea what this is all about. Thanks in advance! This is a group to support Outlook from the Office group of programs. Outlook Express is a part of Internet Explorer and is a quite different program, despite its similar name.. You will...

Where Do Messages Go??
If there isn't a kink in my program and it's behaving as it should, I hope someone can answer my questions. Messages disappear. Example: I e-mailed a friend, who e-mailed me back. When I answered that response, I could find no trace of it in "sent mail" or anywhere else, and the item in my inbox maintained its appearance as unread mail. If I click "mark read" it disappears altogether. I've lost several messages this way. Also I seem to be unable to drag a message from one folder to another. It gets lost in the transporter, never to be seen agai...

unable to send jpgs using Outlook 2002 #2
Hi, I am unable to send jpg files as attachments using Outlook 2002 SP3 = through Gmail. There's no issue sending the same attachments using Outlook Express v6. = No problems sending text files using either client. Anybody have a clue? = There is no issue with the size here - all attachments together were = less than 1 MB. The error is as below: Task 'pop.gmail.com - Sending' reported error (0x800CCC6D) : 'Your = outgoing (SMTP) e-mail server has reported an internal error. If you = continue to receive this message, contact your server administrator or = Internet service prov...

Where do I begin with a Web Service
My past interface w/my own ws was to call it via HTTP like I would a DLL; ws.doData(cDatabase, schemaOnly, nvDataSet, sInsertSmt) The above was to send name value pairs as a dataset and using only the schema from the target table return a matching insert statement. Never did I need to create a complex XML document. I've done EDI projects and understand the human readable aspect of XML, but not the players or pieces for my current pain. My Challenge: Is to place orders w/a system via their ws, they said, "...send us the XML generated by your application, we'll vali...

How can i use DAO Application
Hello freinds I have a software which is made in MFC and connected with MS Access 97 through DAO(Direct Access Object via MS jet Engine). Now i want to use same software for Postgresql and wanted to connected it through ODBC. Problem is that Old software has been developed for DAO,all main file like ,recordset,view doc r made for DAO. If i want to make it in ODBC,my classes like Set ,view Doc and other would be generated for ODBC. I dont know any option to use same software, Should i write whole software from the begining? I need ur help. thanks Sheikh ...

What function do I use ?
I need advice on what function I need in the following scenarios. 1. Is the value in A2 between 13.00 and 19.00 If true print Yes in B2, if false print No in B2 ====================================== Ex: A1="no" B1=270 C1="n/a" 2. I need to check the numerical value in 3 cells. Only one will have a numerical value, and I want to print that value in C2. 3. I need to check the numerical value in 3 cells. Only one will have a numerical value, and I want to take that value and multiply by 2080 and print in D2. ======================================= I think thi...

Get the modified time of a file
I need a way to receive the modified time of a file (you can see this data when you press 'properties' on a file in the file explorer) , so I've wrote: CTime GetModifiedTime (CString name) { CFile f; if (f.Open((LPCTSTR)name,CFile::modeRead)) { CFileStatus fileStat; if (f.GetStatus(fileStat)) return fileStat.m_mtime; } return 0; } In most cases, this works just fine. the problem is that function CFils::Open sometimes fails. (mostly because the file is being exclusivly opened elsewhere) Is there a way to receive this informati...

Where do the Archives Go?
I cannot find the information Outlook claims to have archived for me. Yes I know how to display the archived calendar, but it's blank. Any ideas? Thanks! I use XP, and Office 2007. "6Sigma 5s No Clue" <6Sigma5sNoClue@discussions.microsoft.com> wrote in message news:B239B721-DCF1-4337-947D-B325D4BF0E4A@microsoft.com... >I cannot find the information Outlook claims to have archived for me. Yes I > know how to display the archived calendar, but it's blank. Any ideas? > Thanks! > > I use XP, and Office 2007. Why do you think Outook is arch...

exporting files....
is there a way whereby i can export into another sheet but the same file of the excel? Hi if you just want to duplicate the sheet, choose edit / move or copy sheet & tick the create a copy box and then click on the Ok. or hold down your ctrl key, while dragging the sheet tab left or right. if you're after anything else please post back with more details. Regards JulieD "troubled bar" <troubled bar@discussions.microsoft.com> wrote in message news:8D72E05C-BDCC-4C9F-B4F5-14362CDDDF65@microsoft.com... > is there a way whereby i can export into another sheet but t...

Outlook blocks me sending and recieving exe's (and other dangerous files!)
From what I have read so far it doesn't seem possible to stop Outlook from taking this (unreasonable) approach to filtering my email. Is there way of turning it off so Outlook can still be used? (I have installed it with Office XP). Thanks, Matt More info here: http://www.slipstick.com/outlook/esecup.htm -- PATRICK REED [Outlook - MVP]~~~~~~ -Microsoft Certified Professional (MCP) -Have you checked http://www.slipstick.com? -Please post your Outlook version! "Matt Thompson" <matt.thompson@sensonics.co.uk> wrote in message news:74bb679b.0307140122.7ee2fb96@posti...

Missing file
When I load excel it gives me a message that file "mobiledb.xla" is not where it should be. I search my computer and can not find such a file. Where can I find a copy or what solutions are there. thank you Hi Go to 'Tools - Add-ins' and uncheck the add-in 'mobilebd' if you don't need this add-in -- Regards Frank Kabel Frankfurt, Germany gb wrote: > When I load excel it gives me a message that > file "mobiledb.xla" is not where it should be. I search > my computer and can not find such a file. Where can I > find a copy or what solu...

Comma-Delimited file convert to worksheet
I would like to open a comma delimited file into a regular worksheet. Hi have you just tried openeing it in Excel. Excel should do the conversion automatically -- Regards Frank Kabel Frankfurt, Germany cnitadesigner wrote: > I would like to open a comma delimited file into a regular > worksheet. ...

saving files problem
how come when i am in the process of saving files in any office programs when I browse for the folder to save it, my mouse picks up any title already in that folder when it is opening instead of keeping the title I had given originally. Then I have to restart all over again or rewrite the title by hand again. It picks any title the mouse pointer is hovering over and you don't know where the pointer would appear in the folder. I have search in the mouse settings and nothing stops it. Any clue would be really appreciated -- Thanks to all I am running laptop Dell D800 1 Gg...

saved over a file
I accidently saved over a file, How can I retrieve a previous version. Unless you have a backup stored somewhere, the original file is gone forever. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com <anonymous@discussions.microsoft.com> wrote in message news:526101c47411$09769950$a601280a@phx.gbl... > I accidently saved over a file, How can I retrieve a > previous version. ...