Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Use XL 2 Edit a .txt File?

Happy Monday!

{{No reply repost from Friday...with clarifications
added, 'cause I guess this is more challenging than I
first anticipated.}}

={

I receive an HTML page from the county, and I save it as
a .prn (csv text) file to preserve columnar allignment.
Recently however, they have changed their HTML editor,
and now I get misinterpreted ampersands in the file.
Consequently, when the "&" is present, the HTML editor
creates "&" from it, and kills the columnar
allignment in the .txt document for the row containing
the ampersand.

Are you with me so far?

If I open the .prn file with Notepad, I simply can Find:
"_&_" and Replace this string with "_&_", then all is
right with the world.

The problem is that this is a very small part of a large
macro that interprets the county's file, digests it,
formats it, archives it as an .xls file, and runs some
other MSO formatting macros against it to produce instant
website posting of the data. I need it to remain
automated completely, as the file size is considerable.

(How) Can I perform the Find & Replace solution on
the .prn file using MSO VB code? I tried Word, but that
jacks up the column formatting when Word opens
the 'Story', interpreted as a webpage document. I tried
Excel, but the HTML file enters Excel as entire rows of
data in single cells (the first cell in each column
contains the entire concatenated record), and that won't
do at all.

Is there a simple, non-formatting, text editor in my
Office Suite? Is there a mode or method (like Open As...
or OpenAs()) that I can apply via VB to the text within
this file (without actually opening it)? I can run an
Excel import from .csv text, but I need to manipulate the
columns first to justify them.

If you want samples, email above.

Thanks in advance, as always,

Matthew

=}
..


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Use XL 2 Edit a .txt File?

Possibly you could open it in excel and get all the data in a single column.
Then do the replace with Edit=Replace (using the code equivalent). Then do
Data=Text to Columns to get your data spread out into separate columns (the
code/VBA equivalent).

You could get the basic code for each operation by turning on the macro
recorder and doing it manually. The Text to columns takes you through the
Text import wizard, but it records a single command (with many options).

--
Regards,
Tom Ogilvy


"Matthew =}" wrote in message
...
Happy Monday!

{{No reply repost from Friday...with clarifications
added, 'cause I guess this is more challenging than I
first anticipated.}}

={

I receive an HTML page from the county, and I save it as
a .prn (csv text) file to preserve columnar allignment.
Recently however, they have changed their HTML editor,
and now I get misinterpreted ampersands in the file.
Consequently, when the "&" is present, the HTML editor
creates "&" from it, and kills the columnar
allignment in the .txt document for the row containing
the ampersand.

Are you with me so far?

If I open the .prn file with Notepad, I simply can Find:
"_&_" and Replace this string with "_&_", then all is
right with the world.

The problem is that this is a very small part of a large
macro that interprets the county's file, digests it,
formats it, archives it as an .xls file, and runs some
other MSO formatting macros against it to produce instant
website posting of the data. I need it to remain
automated completely, as the file size is considerable.

(How) Can I perform the Find & Replace solution on
the .prn file using MSO VB code? I tried Word, but that
jacks up the column formatting when Word opens
the 'Story', interpreted as a webpage document. I tried
Excel, but the HTML file enters Excel as entire rows of
data in single cells (the first cell in each column
contains the entire concatenated record), and that won't
do at all.

Is there a simple, non-formatting, text editor in my
Office Suite? Is there a mode or method (like Open As...
or OpenAs()) that I can apply via VB to the text within
this file (without actually opening it)? I can run an
Excel import from .csv text, but I need to manipulate the
columns first to justify them.

If you want samples, email above.

Thanks in advance, as always,

Matthew

=}
.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Use XL 2 Edit a .txt File?

Right on, Tom,

The macro records the With proceedure, and I can
manipulate specific lines of code after recording it.
What you suggested is my fall-back option, and I already
have started the subs for the Find/Replace and
reformatting. This proceedure creates a lengthy script
as you can imagine, so I hope my solicitation yields
something more concise.

Nonetheless, thank you very much, as any and all advice
and brainstorming here makes us think in different
directions. I may even post in the Word and Access NGs
as well.

Workin' it,

Matthew

=}
-----Original Message-----
Possibly you could open it in excel and get all the data

in a single column.
Then do the replace with Edit=Replace (using the code

equivalent). Then do
Data=Text to Columns to get your data spread out into

separate columns (the
code/VBA equivalent).

You could get the basic code for each operation by

turning on the macro
recorder and doing it manually. The Text to columns

takes you through the
Text import wizard, but it records a single command

(with many options).

--
Regards,
Tom Ogilvy


"Matthew =}" wrote

in message
...
Happy Monday!

{{No reply repost from Friday...with clarifications
added, 'cause I guess this is more challenging than I
first anticipated.}}

={

I receive an HTML page from the county, and I save it

as
a .prn (csv text) file to preserve columnar allignment.
Recently however, they have changed their HTML editor,
and now I get misinterpreted ampersands in the file.
Consequently, when the "&" is present, the HTML editor
creates "&" from it, and kills the columnar
allignment in the .txt document for the row containing
the ampersand.

Are you with me so far?

If I open the .prn file with Notepad, I simply can

Find:
"_&_" and Replace this string with "_&_", then all is
right with the world.

The problem is that this is a very small part of a

large
macro that interprets the county's file, digests it,
formats it, archives it as an .xls file, and runs some
other MSO formatting macros against it to produce

instant
website posting of the data. I need it to remain
automated completely, as the file size is considerable.

(How) Can I perform the Find & Replace solution on
the .prn file using MSO VB code? I tried Word, but

that
jacks up the column formatting when Word opens
the 'Story', interpreted as a webpage document. I

tried
Excel, but the HTML file enters Excel as entire rows of
data in single cells (the first cell in each column
contains the entire concatenated record), and that

won't
do at all.

Is there a simple, non-formatting, text editor in my
Office Suite? Is there a mode or method (like Open

As...
or OpenAs()) that I can apply via VB to the text within
this file (without actually opening it)? I can run an
Excel import from .csv text, but I need to manipulate

the
columns first to justify them.

If you want samples, email above.

Thanks in advance, as always,

Matthew

=}
.




.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Use XL 2 Edit a .txt File?

It should only generate about 3 commands since you are using the built in
capabilities of Excel. Apparently you have a different vision than I. But
I admit that I make some assumptions that the file can be parsed by Text to
Columns.

--
Regards,
Tom Ogilvy


"Matthew =}" wrote in message
...
Right on, Tom,

The macro records the With proceedure, and I can
manipulate specific lines of code after recording it.
What you suggested is my fall-back option, and I already
have started the subs for the Find/Replace and
reformatting. This proceedure creates a lengthy script
as you can imagine, so I hope my solicitation yields
something more concise.

Nonetheless, thank you very much, as any and all advice
and brainstorming here makes us think in different
directions. I may even post in the Word and Access NGs
as well.

Workin' it,

Matthew

=}
-----Original Message-----
Possibly you could open it in excel and get all the data

in a single column.
Then do the replace with Edit=Replace (using the code

equivalent). Then do
Data=Text to Columns to get your data spread out into

separate columns (the
code/VBA equivalent).

You could get the basic code for each operation by

turning on the macro
recorder and doing it manually. The Text to columns

takes you through the
Text import wizard, but it records a single command

(with many options).

--
Regards,
Tom Ogilvy


"Matthew =}" wrote

in message
...
Happy Monday!

{{No reply repost from Friday...with clarifications
added, 'cause I guess this is more challenging than I
first anticipated.}}

={

I receive an HTML page from the county, and I save it

as
a .prn (csv text) file to preserve columnar allignment.
Recently however, they have changed their HTML editor,
and now I get misinterpreted ampersands in the file.
Consequently, when the "&" is present, the HTML editor
creates "&" from it, and kills the columnar
allignment in the .txt document for the row containing
the ampersand.

Are you with me so far?

If I open the .prn file with Notepad, I simply can

Find:
"_&_" and Replace this string with "_&_", then all is
right with the world.

The problem is that this is a very small part of a

large
macro that interprets the county's file, digests it,
formats it, archives it as an .xls file, and runs some
other MSO formatting macros against it to produce

instant
website posting of the data. I need it to remain
automated completely, as the file size is considerable.

(How) Can I perform the Find & Replace solution on
the .prn file using MSO VB code? I tried Word, but

that
jacks up the column formatting when Word opens
the 'Story', interpreted as a webpage document. I

tried
Excel, but the HTML file enters Excel as entire rows of
data in single cells (the first cell in each column
contains the entire concatenated record), and that

won't
do at all.

Is there a simple, non-formatting, text editor in my
Office Suite? Is there a mode or method (like Open

As...
or OpenAs()) that I can apply via VB to the text within
this file (without actually opening it)? I can run an
Excel import from .csv text, but I need to manipulate

the
columns first to justify them.

If you want samples, email above.

Thanks in advance, as always,

Matthew

=}
.




.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default Use XL 2 Edit a .txt File?

See:
http://www.exceltip.com/show_tip/Dat...Excel/494.html

Matthew =} wrote:

Happy Monday!

{{No reply repost from Friday...with clarifications
added, 'cause I guess this is more challenging than I
first anticipated.}}

={

I receive an HTML page from the county, and I save it as
a .prn (csv text) file to preserve columnar allignment.
Recently however, they have changed their HTML editor,
and now I get misinterpreted ampersands in the file.
Consequently, when the "&" is present, the HTML editor
creates "&" from it, and kills the columnar
allignment in the .txt document for the row containing
the ampersand.

Are you with me so far?



  #6   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Use XL 2 Edit a .txt File?

Righ, right,

A lot of the .With stuff appears to be of a default
(unnecessary) nature, and I can just cut all that out.
I'm gettin' there. Thanks again!

Matthew =}
-----Original Message-----
It should only generate about 3 commands since you are

using the built in
capabilities of Excel. Apparently you have a different

vision than I. But
I admit that I make some assumptions that the file can

be parsed by Text to
Columns.

--
Regards,
Tom Ogilvy


"Matthew =}" wrote

in message
...
Right on, Tom,

The macro records the With proceedure, and I can
manipulate specific lines of code after recording it.
What you suggested is my fall-back option, and I

already
have started the subs for the Find/Replace and
reformatting. This proceedure creates a lengthy script
as you can imagine, so I hope my solicitation yields
something more concise.

Nonetheless, thank you very much, as any and all advice
and brainstorming here makes us think in different
directions. I may even post in the Word and Access NGs
as well.

Workin' it,

Matthew

=}
-----Original Message-----
Possibly you could open it in excel and get all the

data
in a single column.
Then do the replace with Edit=Replace (using the code

equivalent). Then do
Data=Text to Columns to get your data spread out into

separate columns (the
code/VBA equivalent).

You could get the basic code for each operation by

turning on the macro
recorder and doing it manually. The Text to columns

takes you through the
Text import wizard, but it records a single command

(with many options).

--
Regards,
Tom Ogilvy


"Matthew =}"

wrote
in message
...
Happy Monday!

{{No reply repost from Friday...with clarifications
added, 'cause I guess this is more challenging than

I
first anticipated.}}

={

I receive an HTML page from the county, and I save

it
as
a .prn (csv text) file to preserve columnar

allignment.
Recently however, they have changed their HTML

editor,
and now I get misinterpreted ampersands in the file.
Consequently, when the "&" is present, the HTML

editor
creates "&" from it, and kills the columnar
allignment in the .txt document for the row

containing
the ampersand.

Are you with me so far?

If I open the .prn file with Notepad, I simply can

Find:
"_&_" and Replace this string with "_&_", then all

is
right with the world.

The problem is that this is a very small part of a

large
macro that interprets the county's file, digests it,
formats it, archives it as an .xls file, and runs

some
other MSO formatting macros against it to produce

instant
website posting of the data. I need it to remain
automated completely, as the file size is

considerable.

(How) Can I perform the Find & Replace solution on
the .prn file using MSO VB code? I tried Word, but

that
jacks up the column formatting when Word opens
the 'Story', interpreted as a webpage document. I

tried
Excel, but the HTML file enters Excel as entire

rows of
data in single cells (the first cell in each column
contains the entire concatenated record), and that

won't
do at all.

Is there a simple, non-formatting, text editor in my
Office Suite? Is there a mode or method (like Open

As...
or OpenAs()) that I can apply via VB to the text

within
this file (without actually opening it)? I can run

an
Excel import from .csv text, but I need to

manipulate
the
columns first to justify them.

If you want samples, email above.

Thanks in advance, as always,

Matthew

=}
.




.



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Excel file pdaws Excel Worksheet Functions 1 May 6th 10 08:48 PM
Importing text file, only option to edit existing file smokey99 Excel Discussion (Misc queries) 8 April 26th 06 09:08 PM
2 users open same file and both can edit/change the file RANDY Excel Discussion (Misc queries) 1 January 24th 06 04:06 PM
Use XL 2 Edit a .txt file? Matthew =} Excel Programming 0 April 16th 04 06:24 PM
Can I edit .iqy file from code? Nathan Gutman Excel Programming 2 December 18th 03 08:29 PM


All times are GMT +1. The time now is 06:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"