473,787 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Project help

I need a routine that will step through a text file of consistent structure
and, based on the content of each line, construct and save another text file.
Outline of the project is as follows:

1. Prompt for location and name of input text file by displaying directory
structure from a default location.
2. Prompt for location of new file with default location tree navigation
shown.
3. New file name to be same as original but with suffix "C"
4. Step through input file line by line
5. At each occurrence of "-------" do the following:
a. Write all the text inside the curly braces preceded by an incrementing
number starting at 1.
b. Construct a new line based on the content of each following line before
the word "THEN" based on the following rules:

"CLOSE" = "close"
"LOW" = "low"
"OPEN" = "open"
"HIGH" = high"
"OF 'X' DAYS AGO" = "(-'X')"
"OF TODAY" = "(0)"
"OF YESTERDAY" = "(-1)"
Operator as is
Each line to be concatenated on a single new line by "&&"
The last two lines before the next "----" to produce "T = +13" on 3rd line
& "S = -13" on 4th line
Each new 'record' in the new file to be separated by a similar line of
"--------------"

Thus the content of the first group of lines between successive "-------"
lines in the specimen input file below would produce the following in the new
file:

"1. {File:ZH610.txt Index:5 Index Date:10001616 PL:73.91% PS:26.09%
Trades:23 CL:2}
close(-7) > close(-5) && close(-5) > close(-6) && close(-6) > close(-8)
T = +13
S = -13"

It's the file handling and looping logic I'm having problems with. I guess
this a complete project description sufficient to do the job - any help (or
the completed project code :-))) ) appreciated.

The format of the input file is shown between the chevrons below
>>>>>>>>>>> >
MODEL LOGIC
----------------------------------------------------------------------------------------------------------------------------------
{File:ZH610.txt Index:5 Index Date:10001616 PL:73.91% PS:26.09%
Trades:23 CL:2}

IF CLOSE OF 7 DAYS AGO > CLOSE OF 5 DAYS AGO
AND CLOSE OF 5 DAYS AGO > CLOSE OF 6 DAYS AGO
AND CLOSE OF 6 DAYS AGO > CLOSE OF 8 DAYS AGO
THEN BUY TOMORROW ON THE OPEN WITH
PROFIT TARGET AT ENTRY PRICE + 13 POINTS
AND STOP LOSS AT ENTRY PRICE - 13 POINTS
----------------------------------------------------------------------------------------------------------------------------------

{File:ZH610.txt Index:6 Index Date:10001615 PL:84.62% PS:15.38%
Trades:13 CL:1}

IF CLOSE OF YESTERDAY > CLOSE OF TODAY
AND CLOSE OF TODAY > CLOSE OF 3 DAYS AGO
AND CLOSE OF 3 DAYS AGO > CLOSE OF 2 DAYS AGO
AND CLOSE OF 2 DAYS AGO > CLOSE OF 4 DAYS AGO
THEN BUY TOMORROW ON THE OPEN WITH
PROFIT TARGET AT ENTRY PRICE + 13 POINTS
AND STOP LOSS AT ENTRY PRICE - 13 POINTS
----------------------------------------------------------------------------------------------------------------------------------

{File:ZH610.txt Index:7 Index Date:10001606 PL:81.82% PS:18.18%
Trades:22 CL:1}

IF CLOSE OF 5 DAYS AGO > CLOSE OF 4 DAYS AGO
AND CLOSE OF 4 DAYS AGO > CLOSE OF 6 DAYS AGO
AND CLOSE OF 6 DAYS AGO > CLOSE OF 7 DAYS AGO
AND CLOSE OF 7 DAYS AGO > CLOSE OF 8 DAYS AGO
AND CLOSE OF 8 DAYS AGO > CLOSE OF 9 DAYS AGO
THEN BUY TOMORROW ON THE OPEN WITH
PROFIT TARGET AT ENTRY PRICE + 13 POINTS
AND STOP LOSS AT ENTRY PRICE - 13 POINTS
----------------------------------------------------------------------------------------------------------------------------------
>>>>>>>> >>

Jan 7 '06 #1
1 1209
Thats a lot of description you have there. Any chance you could narrow your
request down to a specific question or questions, more of us would be able
to help you then.

chrisj
"PeterPr" <Pe*****@discus sions.microsoft .com> wrote in message
news:C7******** *************** ***********@mic rosoft.com...
I need a routine that will step through a text file of consistent structure
and, based on the content of each line, construct and save another text
file.
Outline of the project is as follows:

1. Prompt for location and name of input text file by displaying directory
structure from a default location.
2. Prompt for location of new file with default location tree navigation
shown.
3. New file name to be same as original but with suffix "C"
4. Step through input file line by line
5. At each occurrence of "-------" do the following:
a. Write all the text inside the curly braces preceded by an incrementing
number starting at 1.
b. Construct a new line based on the content of each following line before
the word "THEN" based on the following rules:

"CLOSE" = "close"
"LOW" = "low"
"OPEN" = "open"
"HIGH" = high"
"OF 'X' DAYS AGO" = "(-'X')"
"OF TODAY" = "(0)"
"OF YESTERDAY" = "(-1)"
Operator as is
Each line to be concatenated on a single new line by "&&"
The last two lines before the next "----" to produce "T = +13" on 3rd
line
& "S = -13" on 4th line
Each new 'record' in the new file to be separated by a similar line of
"--------------"

Thus the content of the first group of lines between successive "-------"
lines in the specimen input file below would produce the following in the
new
file:

"1. {File:ZH610.txt Index:5 Index Date:10001616 PL:73.91% PS:26.09%
Trades:23 CL:2}
close(-7) > close(-5) && close(-5) > close(-6) && close(-6) > close(-8)
T = +13
S = -13"

It's the file handling and looping logic I'm having problems with. I guess
this a complete project description sufficient to do the job - any help
(or
the completed project code :-))) ) appreciated.

The format of the input file is shown between the chevrons below
>>>>>>>>>>> >>
MODEL LOGIC
----------------------------------------------------------------------------------------------------------------------------------
{File:ZH610.txt Index:5 Index Date:10001616 PL:73.91% PS:26.09%
Trades:23 CL:2}

IF CLOSE OF 7 DAYS AGO > CLOSE OF 5 DAYS AGO
AND CLOSE OF 5 DAYS AGO > CLOSE OF 6 DAYS AGO
AND CLOSE OF 6 DAYS AGO > CLOSE OF 8 DAYS AGO
THEN BUY TOMORROW ON THE OPEN WITH
PROFIT TARGET AT ENTRY PRICE + 13 POINTS
AND STOP LOSS AT ENTRY PRICE - 13 POINTS
----------------------------------------------------------------------------------------------------------------------------------

{File:ZH610.txt Index:6 Index Date:10001615 PL:84.62% PS:15.38%
Trades:13 CL:1}

IF CLOSE OF YESTERDAY > CLOSE OF TODAY
AND CLOSE OF TODAY > CLOSE OF 3 DAYS AGO
AND CLOSE OF 3 DAYS AGO > CLOSE OF 2 DAYS AGO
AND CLOSE OF 2 DAYS AGO > CLOSE OF 4 DAYS AGO
THEN BUY TOMORROW ON THE OPEN WITH
PROFIT TARGET AT ENTRY PRICE + 13 POINTS
AND STOP LOSS AT ENTRY PRICE - 13 POINTS
----------------------------------------------------------------------------------------------------------------------------------

{File:ZH610.txt Index:7 Index Date:10001606 PL:81.82% PS:18.18%
Trades:22 CL:1}

IF CLOSE OF 5 DAYS AGO > CLOSE OF 4 DAYS AGO
AND CLOSE OF 4 DAYS AGO > CLOSE OF 6 DAYS AGO
AND CLOSE OF 6 DAYS AGO > CLOSE OF 7 DAYS AGO
AND CLOSE OF 7 DAYS AGO > CLOSE OF 8 DAYS AGO
AND CLOSE OF 8 DAYS AGO > CLOSE OF 9 DAYS AGO
THEN BUY TOMORROW ON THE OPEN WITH
PROFIT TARGET AT ENTRY PRICE + 13 POINTS
AND STOP LOSS AT ENTRY PRICE - 13 POINTS
----------------------------------------------------------------------------------------------------------------------------------
>>>>>>>>> >>>

Jan 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1435
by: Edward Stevens | last post by:
The IDE Start Page in .Net 2003 contains a list of the projects you have recently worked on. Clicking on any of these opens that particular project. Fine. Unfortunately, one of my projects has been moved to a new directory. While I have manually opened the project in its new directory and made edits, etc., the IDE is not updating the Start Page with the correct path for the project.
5
11055
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been created in the wrong folder on the hard drive. Before I discovered these files, .NET kept trying to create a new project with _1 following the project name. Deleting those files corrected that problem. I deleted the Virtual Directory, rebooted, and...
10
9924
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I want to obtain is not possible, but I would like the advice of more experienced python programmers. I am writing a relatively complex program in python that has now around 40 files.
2
1953
by: genc_ymeri | last post by:
Hi, We are a team of 4 using win2003 server (sp1) in our dev machines and VS2003 for our .Net web app. We did make a copy of our project (located to one "hardwarely old" PC ) to our machines. All of us are getting the above error in ths subject. Everything works fine in the original machine. (project name is not the same neither include the any machine name). We did read all MSDN article and others in our goold search. We made sure...
1
1605
by: Vladimír Kolesnik | last post by:
Hi, there we need help concerning setting project under source control. We want to have a project on the server, and developers in the local network working on this project. We decided to use strategy officialy called "Isolated Development". We studied help in Visual Studio .NET called "Web Projects and Source Control Integration in Visual Studio ..NET". First we created solution on machine: A (server), then added a web project to this...
3
2258
by: alan_coffman2004 | last post by:
Opening an ASP.NET VS2002 project in VS2003, am getting this error: "Unable to open Web project 'MyProject'. The file path 'c:\inetpub\wwwroot\MyProject' does not correspond to the URL 'http://Localhost:/MyProject'. The two need to map to the same server location. HTTP Error 404: Not Found." I have tried fixing this using both of these KB articles and usenet advises, still problem not solved:
3
2199
by: Jerad Rose | last post by:
This is regarding Visual Studio 2003 (framework 1.1). We have several projects/libraries. Of course, many of these reference each other. If we only had one solution, we would simply add all of the libraries that we wish to debug to the solution, and make project references to the other projects within the solution. All other library references would be file references, since they were not included in the solution. However, the...
4
3404
by: NareshKumar | last post by:
Hi all, I'm using existing ASP.net project to make some enhancements which is secured by Visual source safe and in my system frontpage is installed. Now when i run the project file i get following error 'The project you are trying to open is a web project. You need to open it by specifying its URL path.' I also referred to help. In help i came to know that i may need to open the project file by using "Open project from web.. " from file...
24
2796
by: =?Utf-8?B?RHIuIFMu?= | last post by:
I am incorporating three existing programs into a new "all in one" program. I have added the three projects to the new all in one project. How do I instruct the new initial menu to launch the main menu in each one? I have tried using the DIM statement with .ShowDialog, however, the forms are not recognized as they are listed in seperate projects. Please advise. Thanks, Dr. S.
4
4474
by: Alan Mailer | last post by:
Again, I'm new to VB.net and there is something I need help with: Like (I assume) many of us, over time I want to be able to create some VB.net classes that I might want to use in more than one Project. So let's say I've created a Folder called "MyVBNet Classes" to hold these general-use VB.Net class files that I will eventually associate with various Projects I create. Now let's imagine I've created a class called "MyClass.vb" that...
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.