Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default replace character in txt file before import to excel

Hi all,

Background
I have a vba rutine that imports a csv file to excel.
The source application where the data is taken from sometimes contain a
semicolon sign ";" with a text field. The semicolon will cause an offset
of the data in excel when the user regional settings is using semicolon
as a delimiter.

Question
is it possible to use some vba code that will replace ";" with for
example "|" before the import of the file to excel is done?

Any ideas are warmly welcome
- Chr
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default replace character in txt file before import to excel

You can only remove the unwanted semicolons if you know which ones are the
good ones and which are the bad ones. You have to first look at the text
file and identify why the bad ones are in the file. Only then can you filter
out the bad ones.

"Christian" wrote:

Hi all,

Background
I have a vba rutine that imports a csv file to excel.
The source application where the data is taken from sometimes contain a
semicolon sign ";" with a text field. The semicolon will cause an offset
of the data in excel when the user regional settings is using semicolon
as a delimiter.

Question
is it possible to use some vba code that will replace ";" with for
example "|" before the import of the file to excel is done?

Any ideas are warmly welcome
- Chr

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default replace character in txt file before import to excel

Hi Joel,

Sure. For this particular project all ";" are unwanted. Actual you just
made me think! Maybe the actual import goes ok as the "," is used as
delimiter, maybe the ";" is causing problems further down in one of the
many other sub rutines I execute when processing the file. Have to check
that.

Thanks for pointing out the obvious - it's needed sometimes :-)

Btw if I find that the ";" has to go is there a way i can get excel to
do search&replace in the file without importing it first? At the moment
the user is opening the file in notepad and does the search replace
first before using the file with excel.
- Chr

Joel wrote:
You can only remove the unwanted semicolons if you know which ones are the
good ones and which are the bad ones. You have to first look at the text
file and identify why the bad ones are in the file. Only then can you filter
out the bad ones.

"Christian" wrote:

Hi all,

Background
I have a vba rutine that imports a csv file to excel.
The source application where the data is taken from sometimes contain a
semicolon sign ";" with a text field. The semicolon will cause an offset
of the data in excel when the user regional settings is using semicolon
as a delimiter.

Question
is it possible to use some vba code that will replace ";" with for
example "|" before the import of the file to excel is done?

Any ideas are warmly welcome
- Chr

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
find replace excel remove single character AlaskaBoy Excel Discussion (Misc queries) 5 March 31st 08 03:16 PM
replace this Å“ character with pound sign in excel r1947 Excel Discussion (Misc queries) 4 April 7th 07 06:30 AM
find a character and replace with a command in Excel Jo Excel Discussion (Misc queries) 1 June 27th 06 12:50 PM
How do you find and replace a Wildcard character in Excel? Wildcard Excel Discussion (Misc queries) 8 August 18th 05 01:18 AM
How do I replace * as a character in a string in Excel? nicolegt Excel Programming 1 January 21st 05 10:42 AM


All times are GMT +1. The time now is 10:16 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"