Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: NotePad File Data Capture to C++ Program


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 11 - Last Post: Aug 16, 2017 8:28 AM Last Post By: Andrew McIsaac
Andrew McIsaac

Posts: 93
Registered: 3/12/13
NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 14, 2017 10:31 AM
Good morning,

Using C++ Builder VCL -

I am manipulating outputted data from an ERP system. I do not have access to the datatables themselves, so I am left with only being able to manipulate the outputted data.
The Data is in the form of NotePad text files.

Once this file is displayed, rather than having users save, and then use dialog promts to open file to open -
Is there a way I could Copy Paste all data from an Open Notepad File -
This would really save time .

Thank you.
Andrew
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 14, 2017 12:36 PM   in response to: Andrew McIsaac in response to: Andrew McIsaac
Andrew McIsaac wrote:

Once this file is displayed, rather than having users save, and then
use dialog promts to open file to open - Is there a way I could Copy
Paste all data from an Open Notepad File - This would really save
time .

Technically yes (it is not trivial, though), but why bother interacting
with Notepad at all? Why not just load the same .txt file that Notepad
loads? You can use a TStringList for that, for instance.

--
Remy Lebeau (TeamB)
Andrew McIsaac

Posts: 93
Registered: 3/12/13
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 14, 2017 1:12 PM   in response to: Andrew McIsaac in response to: Andrew McIsaac
Thanks for the reply,

Problem is the textfile is created as an output file.
The ERP is dated - an older program - and getting info out is painful.
The ERP creates the report from tables - and can display in a viewable "notepad" option.

user could save this file - and I can then have user use the program and go to the same DIR / FIle - but the DIR structure is also painful - 10 - 15 sub DIR deep....
That's why I was hoping to just copy the data from the Current NotePad file.

Thanks.
Andrew
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 14, 2017 1:23 PM   in response to: Andrew McIsaac in response to: Andrew McIsaac
Andrew McIsaac wrote:

Problem is the textfile is created as an output file.

So? As soon as the file is created on the filesystem, you can access
it. How do you think Notepad is able to access it?

The ERP is dated - an older program - and getting info out is painful.

What does that have to do with being able to open a text file in your
own app?

The ERP creates the report from tables - and can display in a
viewable "notepad" option.

In order to do that, it has to create a text file first, and then tell
Windows to open that file in the user's default text editor (which is
usually Notepad). So, the file is fair game to any program that wants
to access it (provided the user that is running that program has
adequate rights to the file).

user could save this file

You can load the file into your own app before the user even sees it
appear in Notepad.

--
Remy Lebeau (TeamB)
Andrew McIsaac

Posts: 93
Registered: 3/12/13
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 14, 2017 1:33 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank you, I understand what you are saying.

The ERP creates the Text file then displays this, yes you are correct.

Looked into - and found out files are on a non-windows box - and Users do not have acess to this.

Simple option would be for user to just copy all and paste into the program ?
kind of a temp-Band-Aid, but still better than saving t a user permitted drive and then opening into program.

thanks for your help.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 14, 2017 3:11 PM   in response to: Andrew McIsaac in response to: Andrew McIsaac
Andrew McIsaac wrote:

Looked into - and found out files are on a non-windows box - and
Users do not have acess to this.

Someone has to, or else Notepad (which runs as a user) coudn't access
the file, either.

--
Remy Lebeau (TeamB)
Harry Bego

Posts: 22
Registered: 1/27/09
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 1:10 AM   in response to: Andrew McIsaac in response to: Andrew McIsaac
Andrew McIsaac wrote:
user could save this file

It is already saved. Notepad reads it from disk. Your program can do that as well.

To find out where it is saved, with the file loaded in Notepad use File > Save as.
Andrew McIsaac

Posts: 93
Registered: 3/12/13
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 7:42 AM   in response to: Harry Bego in response to: Harry Bego
yes it is saved,
and thank you for the suggestion.

The ERP is on a non windows machine, and is accessed through Citrix.
I tried the Save As to see - but it defaults the drive location to users permissions, which do not include the ERP machine.

Spoke to I.T. said users can not have access, nor could we have a 'mapped' location to the directory.
Frustrating. ...

Thank you everyone for all your help.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 9:23 AM   in response to: Andrew McIsaac in response to: Andrew McIsaac
Andrew McIsaac wrote:

Spoke to I.T. said users can not have access, nor could we have a
'mapped' location to the directory. Frustrating. ...

Then how is Notepad accessing the file? Whatever Notepad does, you can
do in your code, too.

--
Remy Lebeau (TeamB)
Andrew McIsaac

Posts: 93
Registered: 3/12/13
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 12:22 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Yes, you are correct.
I should be able to do the same with my program, problem is the ERP that creates theses is using datatables that I / users do not have access to.
Users have access to these reports only through a window of the ERP.
Its a no-win.

Thanks,
Andrew
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 8:28 PM   in response to: Andrew McIsaac in response to: Andrew McIsaac
Andrew McIsaac wrote:

problem is the ERP that creates theses is using datatables that
I / users do not have access to.

That is irrelevant, since the data is being exported to a text file.

Users have access to these reports only through a window
of the ERP. Its a no-win.

Does that mean the Notepad window is actually being displayed from a
remote machine, and not on the user's machine? If it is on the user's
machine, then the text file is accessible to the user, and thus is
accessible to your app.

--
Remy Lebeau (TeamB)
Andrew McIsaac

Posts: 93
Registered: 3/12/13
Re: NotePad File Data Capture to C++ Program  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 16, 2017 8:28 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thanks for responding.

Remy Lebeau (TeamB) wrote:
That is irrelevant, since the data is being exported to a text file.

This Data is from the ERP on a separate machine, which users connect with Citrix, therefore this is relevant - as I don't have access to the tables to create the same report info, and I don't have access to the Notepad files.
The Notepad files are being Displayed from the ERP - again from a machine through Citrix - where users are prevented from accessing anything on this box. We can only view reports from a window in the ERP.

Sorry if any of this was unclear.

I know everyone reading this is wondering why this is difficult - or such primitive functionality of the ERP - its an older one, also with proprietary database programs...

I have, as of now built the app to load the textfile from a designated Common Directory that the users have access to - to save their textfiles to, after they open / view their report.

Its a Band-Aid - but functional.
I am pushing to have access to the tables as well, so there is hope to reduce the steps.

Thank you everyone.
Andrew
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02