Deleting text files after use

I am opening up a text file and reading its contents.  Once I am done 
processing the file I would like to remove it so the code knows not to repeat 
the process the next time that window is open.  I can't seem to find a 
"TextFile_Delete" anywhere.  Am I missing it somewhere?

Thanks,
Don
0
rengeek33 (60)
2/13/2006 10:01:23 PM
greatplains 29623 articles. 6 followers. Follow

3 Replies
484 Views

Similar Articles

[PageSpeed] 16

Nevermind - I wrote this too soon.  I found File_Delete.

Sorry for the inconvenience...

Don

"rengeek33" wrote:

> I am opening up a text file and reading its contents.  Once I am done 
> processing the file I would like to remove it so the code knows not to repeat 
> the process the next time that window is open.  I can't seem to find a 
> "TextFile_Delete" anywhere.  Am I missing it somewhere?
> 
> Thanks,
> Don
0
rengeek33 (60)
2/13/2006 10:08:34 PM
Is this in Integration Manager? If so, can you share the solution/paste the 
script to this post?


"rengeek33" <rengeek33@nospamhere.com> wrote in message 
news:B1CC8301-55BA-4D3E-A6A1-5EEA859C6E9D@microsoft.com...
> Nevermind - I wrote this too soon.  I found File_Delete.
>
> Sorry for the inconvenience...
>
> Don
>
> "rengeek33" wrote:
>
>> I am opening up a text file and reading its contents.  Once I am done
>> processing the file I would like to remove it so the code knows not to 
>> repeat
>> the process the next time that window is open.  I can't seem to find a
>> "TextFile_Delete" anywhere.  Am I missing it somewhere?
>>
>> Thanks,
>> Don 


0
jacktundra (359)
2/14/2006 3:14:10 AM
The procedure opens a text file that contains a stored procedure.  It use 
SQL_Passthrough to "USE" the correction database, read the text file, and 
execute the SQL statements.  This must be called from a form and the form 
needs to have two text fields called '(L) SQL_Statements' and '(L) 
query_results' (or you can change the names in the procedure. 

The procedure follows:

****************************************
local long SQL_connection, status;
{SQL error information}
local string dbname, dbopencommand, feedback;
local integer dictid, compid;
local long GPS_error_number, SQL_error_number;
local string SQL_error_string, ODBC_error_string;
local integer l_file_ID,l_index;
local string l_pathname, l_text;
local boolean l_EOF,l_result;

{open the text file with the stored procedures}
l_pathname = Path_GetForApp(2) + "POXStProcUpdate.txt";
{check to make sure the file exists, or don't run the process}
l_result = File_Probe(l_pathname);
if l_result then
	l_file_ID = TextFile_Open(l_pathname, 0, 1);
	{Display the pathname in the window - this is only useful for debugging.}
	'(L) query_results' = l_pathname;
	{Check for errors opening the file.}
	if (l_file_ID = 0) then
		{The file couldn’t be opened.}
		warning "There was an error opening the text file.";
		{Release the file ID.}
		l_result = TextFile_Close(l_file_ID);
		abort script;
	end if;
	compid = 'Company ID' of globals;
	dbname = 'Intercompany ID' of globals;
	dbopencommand = "use " + dbname;

	status = SQL_Connect(SQL_connection);
	if status = 0 then
		{Use the appropriate database for the current company.}
		set '(L) SQL_Statements' to dbopencommand;
		{Execute the SQL statements.}
		status = SQL_Execute(SQL_connection, field '(L) SQL_Statements');
		if status = 0 then
			{Loop through the file to examine each line.}
			'(L) SQL_Statements' = "";
			l_EOF = false;
			while not l_EOF do
				l_EOF = TextFile_ReadLine(l_file_ID, l_text);
				if l_text = "GO" then
					l_text = ";";
				end if;
				'(L) SQL_Statements' = '(L) SQL_Statements' +  l_text + char(13);
			end while;
			l_result = TextFile_Close(l_file_ID);
			status = SQL_Execute(SQL_connection, field '(L) SQL_Statements');
			l_result = File_Delete(l_pathname);
		end if;
	end if;
end if;
*************************************************
I hope this helps.  Let me know if I can help any further.

Don

"Jack Tundra" wrote:

> Is this in Integration Manager? If so, can you share the solution/paste the 
> script to this post?
> 
> 
> "rengeek33" <rengeek33@nospamhere.com> wrote in message 
> news:B1CC8301-55BA-4D3E-A6A1-5EEA859C6E9D@microsoft.com...
> > Nevermind - I wrote this too soon.  I found File_Delete.
> >
> > Sorry for the inconvenience...
> >
> > Don
> >
> > "rengeek33" wrote:
> >
> >> I am opening up a text file and reading its contents.  Once I am done
> >> processing the file I would like to remove it so the code knows not to 
> >> repeat
> >> the process the next time that window is open.  I can't seem to find a
> >> "TextFile_Delete" anywhere.  Am I missing it somewhere?
> >>
> >> Thanks,
> >> Don 
> 
> 
> 
0
rengeek33 (60)
2/14/2006 4:17:27 AM
Reply:

Similar Artilces:

How can I open a file saved in Pub 2000 version 6 in Pub 2000 ver.
The file is saved in Publisher 2000 v6 and I am trying to open it with Publisher 2000 v9. can this be done? Hi LaTrice (LaTrice @discussions.microsoft.com), in the newsgroups you posted: || The file is saved in Publisher 2000 v6 and I am trying to open it || with Publisher 2000 v9. can this be done? No. There is no such thing as Publisher 2000 v9, nor is there a version 9 of Publisher, yet. Verify the version of Publisher that you have, and also verify the version of Publisher that you received the file from then post back. -- Brian Kvalheim Microsoft Publisher MVP http://www.publi...

Stagger X-axis text
In 1-2-3 I could stagger the text in the X-axis. In Excel it seems that I can only rotate the text to 90 degrees. Is there a way to stagger and leave horizontal? Specifically, I have all the provinces (or 10 of them) across the axis and they take up room when spelt out (no abbreviations allowed). I would rather the first, third, fifth ... etc. be higher and the second, fourth etc. be lower to allow the chart to be narrower and still read the text clearly. Cheers, Deborah >-----Original Message----- >In 1-2-3 I could stagger the text in the X-axis. In Excel it seems Deborah I would...

exporting a report in text
I have data in one table for which I have created formatted reports - 1 by program number and 1 by last name. I have the reports the way I want them to look. I need to have them in text-delimited format. The reason for this is that I need to be able to upload them into a DREAMWEAVER table. If they are in the text-delimited format I can upload all the reports fairly easily. Otherwise, I have to export them to WORD as a table, and then laboriously upload them to Dreamweaver column by column as DW will not accept the whole report. (It is doable, but not too convenient. Than...

How do I get excel to accept (c) as text and not change to copyri.
How do I enter the text (c) in Excel without having it changed into the copyright symbol? Hi Daffyd, Try: Tools | Autocorrect | Select (c) | Delete | OK --- Regards, Norman "daffyd" <daffyd@discussions.microsoft.com> wrote in message news:8CCC3C1A-6F19-4F62-B934-8A71F236A4FD@microsoft.com... > How do I enter the text (c) in Excel without having it changed into the > copyright symbol? Go into the Tools Menu. Look for AutoCorrect. In the bottom half of the AutoCorrect Tab, look at the list for Replace text as you type. Delete the entry for (c). tj "da...

problem using tab
When I hit the tab button the selection jumps several columns over instead of going to the next column. What's strange is that this seems to happen only on one computer in the network and not on the others. The document is shared so I think it is maybe the formatting for that computer's excel. Does anyone know what is going on? Hi Tools > Options > Transition, uncheck "transision navigation keys". HTH. Best wishes Harald (Not knowing what's going on, just how to get rid of it :-) "officebug" <officebug@discussions.microsoft.com> skrev i me...

Numbers in a text field-can I add them up?
Hi everyone! Using A02 on XP. I have a table of data with survey response fields that contain a 0,1,2,3,4 or 5. However, the fields are formatted as text, not numbers. I need to add up certain blocks (Items 1-6, Items 7-23, etc.) and then do some averaging. I cannot change the field types from text. Must I append to a new table or can I do something right in my query? I've got one field in my query like this: ES: [Item1]+[Item2]+[Item3]+[Item4]+[Item5]+[Item6] My result is: 553453 or 554444, etc. I want: 25 or 22, etc. I would really appreciate any help or advice. Thanks...

Using Money on a pocket PC
I am trying to install Money for the pocket pc on my new IPAQ which has the new Pocket PC 2003 Prem as the operating system. After sync - the IPAQ reads "Error - This version of Money for the Pocket PC can only be installed on devices running Pocket PC 2002." I am currently using Money 2003. Can anyone help me? A known problem, which MS hasn't fixed yet. There's a workaround that some folks have used: Follow these instructions and you should be able to install Money for the PPC (2003 version): 1. With the PPC in the cradle and ActiveSync running, start the install...

Deleting a half sent message
Sorry, forgot to say that I have Outlook 2003:) ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ...

Cannot log in using WindowsID (was able to before)
I just bought MS Money 2007 Deluxe yesterday. The install went smooth, without any issues. I registered a new WindowsID and was able to successfully log into MS Money. However, today when I tried to log into MS Money, the messge apeared that the "Money was not able to recognize your WindowsID" or something like it and that "You will still have access to some functions but will not be able to make online updates". Now I'm not able to make updates. Any idea what this could be? Is the authentication server for WindowsID down or something? See the post under Mon...

Can't use Merge feature
If I have a postcard file I've already made on the screen, when I try to pull up the "Merge" feature under Tools, it is shaded grey and I can't open it. It insists that I either form a new database list of addresses or edit the one that I want to merge. I don't want to edit the one I want to merge. I just want to MERGE it. If, however, I have just a postcard template on the screen (without it having been made into anything), I CAN pull up the "merge" feature under Tools. It is not shaded out. How do I un-shade the "merge" feature? To merg...

Restore Exchange 5.5 on 2000 using ArcServe
I've got - Windows NT 4 Server SP6 - Exchange 5.5 SP3 - ArcServeIT 6.61 with Exchange Agent I'm trying to restore the Exchange information (database, mailbox... everything) on another computer. That computer has - Windows 2000 Server SP4 - Exchange 2000 - Brighstore ArcServe 9 (build 2020) with Exchange Agent ------------------- Now the situation: I need to verify that the backup was made correctly (entirely) in order to confirm the total validity of the backup (to validate my disaster recovery plan) and to update to SP4. I tried to find documentation with both Microsoft (for Ex...

How to use structured reference (ListColumns) in VBA
I want to do something simple...loop through a range retrieving values one at time and taking action on that value. This range is an Excel 2007 table column. Easy enough...BUT I want to use structured references to a table column by NAME, not numbers. I don't want to define new names, just use the table column headings. I've found ways of doing it with quotes, but that's not structured....the names in quotes do not change if the table heading is changed by the user. The formulas change if the table column heading is changed, but I want it to change in VBA to...

Deleted exchange 5.5 site not replicating over the ADC to Exchange 2000 side
We are a part of a shared Exchange 5.5 organization but our site is primarily Exchange 2000/2k3. We maintain a single 5.5 server as the rest of the Org is 5.5. The problem we are seeing is when the folks who control the Organization at the top level remove a site that is no longer used, that deletion is not carrying over the CONFIG_CA agreement to the Exchange 2000/AD side. Our Exchange 5.5 server executes the deletion with no issue. Any ideas on why this deletion is not replicating properly over the ADC and throught the SRS database? In the past we have manually removed the sites/recipie...

automatically naming files for savingb
Hi, for delivery notes i would like excel to look in the relative directory for a given customer, ie if C4 contains superspecs, files relating to this account would be in c:\work\superspecs\ files are named superspecsdel0001,superspecsdel0002.......etc superspecsinv0001...etc for delivery notes and invoices. what i would like is a line (or more) to add to a macro which will look in the appropriate directory, add 1 to the last four digits of the last file, enter this number into a cell on the sheet and save the new file with the appropriate name, then close the file. is this possible, or alte...

why do changes only save locally on networked excel file?
why do changes only save locally on networked excel file? ...

VISIO 2007 -Text direction
can some one tell me how to change text to be type in vertically. Under tools, options there is no regional tab or under format text the change text direction command does not work. "kgbrat" <kgbrat@discussions.microsoft.com> wrote in message news:2DBF18B5-E1C8-4493-8BEF-F7D4C1538781@microsoft.com... > can some one tell me how to change text to be type in vertically. Under > tools, options there is no regional tab or under format text the change > text > direction command does not work. You can use the Text Tool (The A with an circular arrow around it) and gr...

Help ! formatting data to text
I am creating data in an Excel spreadsheet. I then want to get that data into a simple text email. I have some problems and questions... 1) how do I get the columns of data to line up evenly when I copy the data to email text ? Keep in mind I need to be in simple text format, not HTML or rich text. Every time I do this, all columns become chaos and are unreadable. 2) Is there a simple way to automate the creation of an email from an excel file ? this is less important to me. Thanks in advance WxMachine #1. I think it may have to do with what email client you use, too. I copy and ...

Save As using contents of Cell in Name
Can someone help with code that changes the "save As" file name to combination of the original File Name + the contents of a cell, an saves file in same folder as the original. E.G. Original File Name= Timesheet Cells B1= Location Cell C1 = Date in format 3-5-2004 Cell A1 = concatenate(B1,C1) Fle Name will therefore be "Timesheet Location 3-5-2004" The other problem is with the date. When concatenating, how do I forma the date to avoid it looking like "Location 38051" Any help much appreciated Nic -- Message posted from http://www.ExcelForum.com Hi for c...

Default value of combo box based on another that uses DLookUp
Hi, I have a problem I'm trying to overcome regarding just one form which gets its data from 1 table. I'm trying to set the default value of a combo box to be the same as another combo box on the same form. The scenario is: I have a form for entering info about financial planning Statements Of Advice. Each client has a Plan Writer prepare their plan. To find the plan writer that last prepared the plan for a client I have a combo box with a DLookUp as its Control Source. =DLookUp("Plan_Writer","qryDefault_Planwriter","[Client]=Form![Client]") I'm usin...

Error- Project is used by another user -Please select another proj
Please see the subject line, when im trying to open a particular project. it gives me following error. I checked the current users, there are no users. Apart from me. There are some non PA users,i tried to remove them from activity. inspite of me removing them from activity, im geting the same error. Help !!! Ramakrishnan Hello Ram, There is a stranded user in PA000001 table. You need to clear this User/Project combination. Ajay "Ram" wrote: > Please see the subject line, when im trying to open a particular project. > it gives me following error. > > I che...

Using Excel spreadsheet as input to Access
Hello, I posted this in the New Users forum but only got one answer, so thought I'd try here as well. Like so many others, I am an Excel newbie. I was a mainframe COBO programmer in another life, but that was a few years back My manager would like me to write an app that will take tracking dat from an existing Excel spreadsheet (generated by our system) but onl use a select handful of columns as input to a new Access database tha I will create. I'm guessing that I can either a) create a new edited spreadsheet to b used as input to the Access database or b) use the Import wiza...

How to obtain enumerated attribute declarations from a DTD using MSXML & VB?
I have a VB (VB6, not .NET) application that reads an XML file (using MSXML v3.2 parser); the XML file contains a reference to an external DTD. The DTD has numerous enumerated attribute declarations like so: <!ATTLIST MyElement MyAttribute (One | Two | Three) "One" > The VB code needs to generate dynamic pick-list for all the attributes that appear in the DTD as part of a data-entry application; each dynamically created pick list should contain all the allowable values for the attribute as defined by the DTD (and presented in some kind of multiple choice control like a comb...

Using Excel in Mac office 2004 with Microsoft/Mac 2008:Analysis toolpack
Although I am disappointed with Office 2008 for Mac because of the absent of Analysis toolpack, I figured things out quite recently that I can still install my Mac office 2004 and use the excel package that contains the Analysis tool pack. How? ...... let me show you: 1. Insert your CD for Mac office 2004 2. When it open on your desk top, two options will be given to you to download the software (a) Office set-up assistant, and (b) Microsoft office 2004. 3. CHOOSE MICROSOFT OFFICE 2004 (Drag the icon onto your desk top) and it will start to run/download. 4. When done, this will appear as ...

Outlook should keep files in the clipboard after closing a window
When you open a message (in a new window) in Outlook 2007, and copy one or more files contained in this message, and then close the window, the file is not kept in the clipboard. I have to copy the file and paste it before closing the window. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I ...

Using Risk+ with MSP 2007
We use Risk+ as a risk simulation tool. We have discovered that it works approximately 20 times SLOWER in MSP 2007 than MSP 2003. Has anyone else run into this problem. If so, is there a remedy? My hunch this not a generic issue, but surely best that you consult with the Risk+ people on this. --rms www.rmschneider.com On 02/03/10 18:08, Tom Mc wrote: > We use Risk+ as a risk simulation tool. We have discovered that it works > approximately 20 times SLOWER in MSP 2007 than MSP 2003. Has anyone else run > into this problem. If so, is there a remedy? W...