# Import Address to Excel Spreadsheet

**URL:** <https://techcommunity.softwareag.com/t/import-address-to-excel-spreadsheet/61783>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-News-and-General-Topics\
**Created:** [December 8, 2006, 11:48pm UTC](https://techcommunity.softwareag.com/t/import-address-to-excel-spreadsheet/61783 "2006-12-08T23:48:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ceanjean](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@ceanjean](https://techcommunity.softwareag.com/u/ceanjean)\
**Post date:** [December 8, 2006, 11:48pm UTC](https://techcommunity.softwareag.com/t/import-address-to-excel-spreadsheet/61783/1 "2006-12-08T23:48:17Z")

</div>

How do you import a multi-line address into a single cell of an Excel spreadsheet from a Natural program?

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 11, 2006, 1:53pm UTC](https://techcommunity.softwareag.com/t/import-address-to-excel-spreadsheet/61783/2 "2006-12-11T13:53:11Z")

</div>

If you want to use a CSV-file:

```auto
define data local
01 #line1 (A10) init <'text1'>
01 #line2 (A10) init <'text2'>
01 #line3 (A10) init <'text3'>
end-define
*
define work file 1 'c:\tmp\Sheet01.csv' type 'ascii'
*
write work file 1
  H'22' /* double quotes = Start of Cell
  #line1
  H'0A' /* Linebreak within a Cell
  #line2
  H'0A' /* Linebreak within a Cell
  #line3
  H'22' /* double quotes = End of Cell
  ';' /* Cell delimiter
  'nextcell' /* content of Next Cell
*
close work file 1
*
end
```

---

<div class="post-metadata">

**Author:** ![Weihnachtsbar](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/weihnachtsbar/32/146_2.png) [@Weihnachtsbar](https://techcommunity.softwareag.com/u/Weihnachtsbar)\
**Post date:** [December 11, 2006, 2:12pm UTC](https://techcommunity.softwareag.com/t/import-address-to-excel-spreadsheet/61783/3 "2006-12-11T14:12:29Z")

</div>

1. More flexible with NAT 6.2:

```auto
DEFINE DATA LOCAL
1 CELL_1 (A) DYNAMIC
1 CELL_2 (A) DYNAMIC
1 CELL_3 (A) DYNAMIC

END-DEFINE
*
DEFINE WORK FILE 1 'c:\my_62.csv' TYPE 'CSV' ATTRIBUTES 'NOAPPEND'
*
COMPRESS 'one line' INTO CELL_1 
COMPRESS 'two lines:' '2nd one' INTO CELL_2 WITH DELIMITER H'0A'
COMPRESS 'three lines:' '2nd one' '3rd one' INTO CELL_3 WITH DELIMITER H'0A'

WRITE WORK 1 VARIABLE CELL_1 CELL_2 CELL_3
CLOSE WORK 1
*
END
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/import-address-to-excel-spreadsheet/61783/4 "2021-04-02T14:40:59Z")

</div>


