Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Saving in text format: why are there ""?

I am trying to save data from an excel spreadsheet under .txt format. However
the final format has quotes "" at the begining and end of certain lines. How
do I get rid of them?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Saving in text format: why are there ""?

That usually is the case if you are saving as a delimited file and the
contents of the cell contains the delimiter within. Remove that situation
and you shouldn't get the double quotes.

Or save the file as fixed space so there are no delimiters.

or you can write code to create the file to fit your specifications. Here
is a start:
http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Rafael" wrote:

I am trying to save data from an excel spreadsheet under .txt format. However
the final format has quotes "" at the begining and end of certain lines. How
do I get rid of them?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Saving in text format: why are there ""?

How do I remove the situation of delimitation when saving as? how do I save
as fixed space? (I tried all types of TXT formats and all of them give me
double quotes)

"Tom Ogilvy" wrote:

That usually is the case if you are saving as a delimited file and the
contents of the cell contains the delimiter within. Remove that situation
and you shouldn't get the double quotes.

Or save the file as fixed space so there are no delimiters.

or you can write code to create the file to fit your specifications. Here
is a start:
http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Rafael" wrote:

I am trying to save data from an excel spreadsheet under .txt format. However
the final format has quotes "" at the begining and end of certain lines. How
do I get rid of them?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Saving in text format: why are there ""?

Formatted Text (space delimited) *.prn

is what is says in the US English version.

--
Regards,
Tom Ogilvy


"Rafael" wrote:

How do I remove the situation of delimitation when saving as? how do I save
as fixed space? (I tried all types of TXT formats and all of them give me
double quotes)

"Tom Ogilvy" wrote:

That usually is the case if you are saving as a delimited file and the
contents of the cell contains the delimiter within. Remove that situation
and you shouldn't get the double quotes.

Or save the file as fixed space so there are no delimiters.

or you can write code to create the file to fit your specifications. Here
is a start:
http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Rafael" wrote:

I am trying to save data from an excel spreadsheet under .txt format. However
the final format has quotes "" at the begining and end of certain lines. How
do I get rid of them?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Saving in text format: why are there ""?

Rafael,
Post a sample of the data you have and the result you want.

NickHK


"Rafael" ...
How do I remove the situation of delimitation when saving as? how do I
save
as fixed space? (I tried all types of TXT formats and all of them give me
double quotes)

"Tom Ogilvy" wrote:

That usually is the case if you are saving as a delimited file and the
contents of the cell contains the delimiter within. Remove that
situation
and you shouldn't get the double quotes.

Or save the file as fixed space so there are no delimiters.

or you can write code to create the file to fit your specifications.
Here
is a start:
http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Rafael" wrote:

I am trying to save data from an excel spreadsheet under .txt format.
However
the final format has quotes "" at the begining and end of certain
lines. How
do I get rid of them?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Saving in text format: why are there ""?

Actually the link that Tom gave me was really helpfull: I adapted the
following code to my program and this was the best was I found to convert
excel data into a text format:

Public Sub ExportToTextFile(FName As String, _
Sep As String, SelectionOnly As Boolean)

Dim WholeLine As String
Dim FNum As Integer
Dim RowNdx As Long
Dim ColNdx As Integer
Dim StartRow As Long
Dim EndRow As Long
Dim StartCol As Integer
Dim EndCol As Integer
Dim CellValue As String


Application.ScreenUpdating = False
On Error GoTo EndMacro:
FNum = FreeFile

If SelectionOnly = True Then
With Selection
StartRow = .Cells(1).row
StartCol = .Cells(1).Column
EndRow = .Cells(.Cells.Count).row
EndCol = .Cells(.Cells.Count).Column
End With
Else
With ActiveSheet.UsedRange
StartRow = .Cells(1).row
StartCol = .Cells(1).Column
EndRow = .Cells(.Cells.Count).row
EndCol = .Cells(.Cells.Count).Column
End With
End If

Open FName For Output Access Write As #FNum

For RowNdx = StartRow To EndRow
WholeLine = ""
For ColNdx = StartCol To EndCol
If Cells(RowNdx, ColNdx).Value = "" Then
CellValue = Chr(34) & Chr(34)
Else
CellValue = Cells(RowNdx,ColNdx).Text
End If
WholeLine = WholeLine & CellValue & Sep
Next ColNdx
WholeLine = Left(WholeLine, Len(WholeLine) - Len(Sep))
Print #FNum, WholeLine
Next RowNdx

EndMacro:
On Error GoTo 0
Application.ScreenUpdating = True
Close #FNum

End Sub


"NickHK" wrote:

Rafael,
Post a sample of the data you have and the result you want.

NickHK


"Rafael" ...
How do I remove the situation of delimitation when saving as? how do I
save
as fixed space? (I tried all types of TXT formats and all of them give me
double quotes)

"Tom Ogilvy" wrote:

That usually is the case if you are saving as a delimited file and the
contents of the cell contains the delimiter within. Remove that
situation
and you shouldn't get the double quotes.

Or save the file as fixed space so there are no delimiters.

or you can write code to create the file to fit your specifications.
Here
is a start:
http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy


"Rafael" wrote:

I am trying to save data from an excel spreadsheet under .txt format.
However
the final format has quotes "" at the begining and end of certain
lines. How
do I get rid of them?




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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Format changes from "General" to "Text" GARY Excel Discussion (Misc queries) 2 March 1st 09 10:18 AM
how do I format some text....."abc123" into "abc 123" [email protected] Excel Discussion (Misc queries) 3 August 8th 07 12:11 AM
Saving as Text (tab delimited) surrounds text with "quotes" Mike521 Excel Discussion (Misc queries) 2 June 8th 06 02:28 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


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