Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab delimited has \240 codes

Status
Not open for further replies.

jimktrains

IS-IT--Management
Jan 19, 2007
50
US
I saved an Excel worksheet as Tab Delimited text and when I open the text file on unix, I see a lot of \240 codes in there which is causing my program problems. What are they and how can I save to text without them?

Jim
 
There is usually a 240 character limit for Space delimited files, but not Tab delimited. Do your cells have more than 240 characters?

You could concatenate your cells in a row to another column and paste the contents of that column to notepad

Alternately, you could ask this question in the VBA forum and someone may have a macro solution.

Canadian eh! Check out the new social forum Tek-Tips in Canada.
With the state of the world today, monkeys should get grossly insulted when humans claim to be their decendents
 


What is a \240 CODE?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I mean when I look at it, this is what I see
\240\240\240\240\240

It's not a limit of 240 characters, it's a control code of \240 that I don't know why it is saving it that way.
 



What do you see in Notepad?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Found it on Google:

Have you tried
sed 's/\\240//g' file


Canadian eh! Check out the new social forum Tek-Tips in Canada.
With the state of the world today, monkeys should get grossly insulted when humans claim to be their decendents
 
You would probably be better off posting this in:
forum80

Canadian eh! Check out the new social forum Tek-Tips in Canada.
With the state of the world today, monkeys should get grossly insulted when humans claim to be their decendents
 
In notepad, after each field it jumps to the next because of the TAB. But after the one field, it has spaces, one for each \240 code, then jumps to the next field. It has spaces in the Excel spreadsheet as well. Is there a way by column to strip the trailing spaces?
 


"It has spaces in the Excel spreadsheet as well"

Simple to get rid of the spaces here!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Yes, the TRIM function

Canadian eh! Check out the new social forum Tek-Tips in Canada.
With the state of the world today, monkeys should get grossly insulted when humans claim to be their decendents
 
I added a new column and put =TRIM(B1) and when I leave the cell, all I see is =TRIM(B1) in that cell. Shouldn't it show the results of the TRIM functions, like when I do a =SUM() function?
 



[quote[I see is =TRIM(B1) in that cellp.quote]

1. Change the FORMAT of the cell from TEXT to GENERAL.

2. EDIT the cell.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 


2. EDIT the cell... and hit ENTER.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Quote: Change the FORMAT of the cell from TEXT to GENERAL.

That allowed me to enter the formula, but when I save it as text again, the new formula field still has the \240 codes in it
 



Please do this.

Copy one cell that seems to contain this problem and PASTE it here in a post.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I found a way to strip it out of the text file on unix. The \240 is an octal character for something unprintable. So I used this unix command

tr -cd '\11\12\40-\176' < infile > outfile

and my outfile is free of the codes.

I guess it is the creator of the Excel file that put that in there that I need to have a conversation with. That's why the =TRIM() functions didn't work because it wasn't a space.

Thanks everyone for your suggestions.

Jim
 

[tt]
=IF(CODE(RIGHT(A1,1))=240,LEFT(A1,LEN(A1)-1),A1)
[/tt]


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top