Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text "comparison" operator for "contains" used in an "IF" Function | Excel Worksheet Functions | |||
Format changes from "General" to "Text" | Excel Discussion (Misc queries) | |||
how do I format some text....."abc123" into "abc 123" | Excel Discussion (Misc queries) | |||
Saving as Text (tab delimited) surrounds text with "quotes" | Excel Discussion (Misc queries) | |||
Insert "-" in text "1234567890" to have a output like this"123-456-7890" | Excel Discussion (Misc queries) |