0

The block generated the fixed width file in SAS, please suggest a substitute in pyspark or python ?

set input_trans_1;
file out; 
put 
@1   sequence_nbr
@10  customer_name
@130 append_year
@134 append_month
@136 zip_code
@141 key_ele
@150 confidence_code
@152 address
@216 city
@266 state
@316 grade
@327 code
;
run;




G R
  • 37
  • 4
  • What do you mean by fixed width? specific columns? like in `select` statement? – ZygD Jun 28 '22 at 06:38
  • A fixed width file is similar to a csv file, but rather than using a delimiter, each field has a set number of characters. – G R Jun 28 '22 at 06:49
  • AFAIK, there are no direct methods in pandas, but there are hacks -- check [this question's](https://stackoverflow.com/questions/16490261/python-pandas-write-dataframe-to-fixed-width-file-to-fwf) answers – samkart Jun 28 '22 at 06:50
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 28 '22 at 07:07

0 Answers0