Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Small square in the cells of CSV files - Text to column

Hi,

I have got some data from my client (in CSV format) and one of the columns
has a small square at the end. Also, many of the cells in that column
contain extra lines in them (just like Alt+Enter).

I used Trim function on this column but neither the square nor the extra
lines are getting removed.

I tried Text to columns with fixed width and NO break line thinking that
this might remove the lines or extra lines but it didnt.

In Text to columns with Delimiter selected as TAB it worked (It seemed so).
Just wanted to know what this small square is. Is it equivalent to TAB?
And is the method of text to columns with delimiter being tab a SAFE way to
clean data of above mentioned type?

Thanks a lot,
Hari
India


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Small square in the cells of CSV files - Text to column

Hi Hari

I had the same problem, Tom Ogilvy said use this line of code to remove it

Cells.Replace What:=Chr(3), Replacement:="", lookat:=xlPart

HTH

Regards Aussie Bob C.

"Hari Prasadh" wrote:

Hi,

I have got some data from my client (in CSV format) and one of the columns
has a small square at the end. Also, many of the cells in that column
contain extra lines in them (just like Alt+Enter).

I used Trim function on this column but neither the square nor the extra
lines are getting removed.

I tried Text to columns with fixed width and NO break line thinking that
this might remove the lines or extra lines but it didnt.

In Text to columns with Delimiter selected as TAB it worked (It seemed so).
Just wanted to know what this small square is. Is it equivalent to TAB?
And is the method of text to columns with delimiter being tab a SAFE way to
clean data of above mentioned type?

Thanks a lot,
Hari
India



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Small square in the cells of CSV files - Text to column

That would assume that the character has an ascii code of 3.

You can examine what codes are there with

Sub Checkcode()
Dim sChr As String, sSTr As String
For i = 1 To Len(ActiveCell.Text)
sChr = Mid(ActiveCell.Text, i, 1)
sSTr = sSTr & Asc(sChr) & "-" & sChr & vbNewLine
Next
MsgBox sSTr
End Sub

Note that you probably won't see the small square, but you should see a
number without a printable character next to it. You would replace chr(3)
with chr(that number)

You would could also try the worksheet function CLEAN.

--
Regards,
Tom Ogilvy



"Robert Christie" wrote in message
...
Hi Hari

I had the same problem, Tom Ogilvy said use this line of code to remove it

Cells.Replace What:=Chr(3), Replacement:="", lookat:=xlPart

HTH

Regards Aussie Bob C.

"Hari Prasadh" wrote:

Hi,

I have got some data from my client (in CSV format) and one of the

columns
has a small square at the end. Also, many of the cells in that column
contain extra lines in them (just like Alt+Enter).

I used Trim function on this column but neither the square nor the extra
lines are getting removed.

I tried Text to columns with fixed width and NO break line thinking that
this might remove the lines or extra lines but it didnt.

In Text to columns with Delimiter selected as TAB it worked (It seemed

so).
Just wanted to know what this small square is. Is it equivalent to TAB?
And is the method of text to columns with delimiter being tab a SAFE way

to
clean data of above mentioned type?

Thanks a lot,
Hari
India





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Small square in the cells of CSV files - Text to column

Hi Tom,

Many times I CSV data from dont know what kind of software and it becomes an
issue to load it in to SPSS. With your generalised solution --You would
replace chr(3) with chr(that number) -- I can programmatically take care of
the cleaning in excel and then upload the data further.

Thnx a lot for CLEAN as well (It works nicely). Wasnt aware of any thing
other than TRIM till now.

Regards,
Hari
India

"Tom Ogilvy" wrote in message
...
That would assume that the character has an ascii code of 3.

You can examine what codes are there with

Sub Checkcode()
Dim sChr As String, sSTr As String
For i = 1 To Len(ActiveCell.Text)
sChr = Mid(ActiveCell.Text, i, 1)
sSTr = sSTr & Asc(sChr) & "-" & sChr & vbNewLine
Next
MsgBox sSTr
End Sub

Note that you probably won't see the small square, but you should see a
number without a printable character next to it. You would replace chr(3)
with chr(that number)

You would could also try the worksheet function CLEAN.

--
Regards,
Tom Ogilvy





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Small square in the cells of CSV files - Text to column

Hi Robert,

Thnx for the help and especially the syntax.

Thanks a lot,
Hari
India

"Robert Christie" wrote in message
...
Hi Hari

I had the same problem, Tom Ogilvy said use this line of code to remove it

Cells.Replace What:=Chr(3), Replacement:="", lookat:=xlPart

HTH

Regards Aussie Bob C.

"Hari Prasadh" wrote:

Hi,

I have got some data from my client (in CSV format) and one of the
columns
has a small square at the end. Also, many of the cells in that column
contain extra lines in them (just like Alt+Enter).

I used Trim function on this column but neither the square nor the extra
lines are getting removed.

I tried Text to columns with fixed width and NO break line thinking that
this might remove the lines or extra lines but it didnt.

In Text to columns with Delimiter selected as TAB it worked (It seemed
so).
Just wanted to know what this small square is. Is it equivalent to TAB?
And is the method of text to columns with delimiter being tab a SAFE way
to
clean data of above mentioned type?

Thanks a lot,
Hari
India







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
How do I a rotate my square radar chart (square-diamond)? Becs I Know Nathing Charts and Charting in Excel 5 April 3rd 23 07:30 PM
Display cells(text) in one column based on cells which are present inother column [email protected] Excel Discussion (Misc queries) 1 May 12th 08 01:40 PM
What is the symbol of 4 small circles arranged in a square? Wes B Excel Discussion (Misc queries) 1 October 11th 07 09:55 PM
I need to replace a non printable character, A small white square Melissa Excel Discussion (Misc queries) 5 July 5th 06 11:38 PM
Regression Output -- R Square versus Adjusted R Square Bonnie Excel Discussion (Misc queries) 1 October 25th 05 12:55 AM


All times are GMT +1. The time now is 10:41 AM.

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

About Us

"It's about Microsoft Excel"