When I export a file in txt, at the beginning and end of each line appears "(quotes) how do I prevent this from happening?
How are you exporting this? Using EG menus or code? Try File->Export->Export [DATANAME], and select a CSV type.
I need to export in txt
With the table open I'm going to Export >> Export Step in Project
I select the format, in case txt and end.
When I do this procedure it is putting quotation marks at the beginning and end of each line.
Post the code you're using.
Não estou exportando através de código.
Com a tabela aberta estou indo em Export >> Export Step in Project
Seleciono o formato, no caso txt e fim.
Quando faço esse procedimento ele está colocando aspas no início e no fim de cada linha.
I am not exporting through code.
With the table open I'm going to Export >> Export Step in Project
I select the format, in case txt and end.
When I do this procedure it is putting quotation marks at the beginning and end of each line.
What version of EG (listed in Help->About) are you using? In newer versions of EG, only values that contain the delimiter will be wrapped in quotes when exported to text (to avoid the ambiguity).
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
version 5.1
@egamorim wrote:
I am not exporting through code.
With the table open I'm going to Export >> Export Step in Project
I select the format, in case txt and end.When I do this procedure it is putting quotation marks at the beginning and end of each line.
There is ALWAYS code in SAS. EG is just a code generator, and as soon as a node is run, you get a tab with the code that was sent to the workspace server.
To be able to recreate your situation, we need
- that code I mentioned (to make sure that our actions in EG generate the same code)
- your dataset that you exported. Use the macro provided in https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to convert your dataset to a data step, and post that here in a code window (6th or 7th icon above the posting window).
Actually, as much as I hate to correct my friend @Kurt_Bremser, there is no SAS code for this step initated from "Export as a Step". EG reads the data and uses local routines to generate a text file. As Casey said, earlier versions of EG added unnecessary quotes -- this is corrected in EG 7.1.
You can, however, use SAS code to achieve what you need. PROC EXPORT, ODS CSV, and simple DATA step can all be used to generate text files from data. Your challenge would then be to copy that data file from your SAS server to your local PC, and that's what the Copy Files task is good for. Here's a blog post that leads you through the steps.
Yes, as mentioned by ChrisHemedinger, there is no code for the way I am doing it.
My table contains only 1 column called Mailing in text format.
Could you code in code how can I export this table into text format?
@egamorim wrote:
Yes, as mentioned by ChrisHemedinger, there is no code for the way I am doing it.
My table contains only 1 column called Mailing in text format.
Could you code in code how can I export this table into text format?
That's simple:
data have;
input email :$100.;
cards;
user.user@domain.com
another_user@some-domain.com
;
run;
data _null_;
file '$HOME/test.txt';
set have;
put email;
run;
The file test.txt looks like that:
user.user@domain.com another_user@some-domain.com
As you can see, no quotes.
Okay, but it still did not work out.
I am illustrating in the attached image.
Notice that in EG the quotes do not appear, but in the yes txt.
You are using the export task from EG instead of the code I gave you. Don't be surprised.
Can I export txt to my local machine?
On my desktop?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.