JohnSUN-Pensioner wrote:Show the sample file of source data... Show the file with the desired result...
not sure how to do that, also the forum doesn't let me upload .yml file, so i changed it .txt
here is the content of the 2 first cells
A1:
A2:
Code: Select all
ShopName: ArcticShop
signs:
text: '[ArcB]'
NeedPermissionToCreateSign: true
DisplayName: Arctic &2Buy
shop:
Chapter:
ExtraPermission: ''
MenuItem:
- name:&2Book Chapter
- lore:&cAccess to this Shop menu#&cfrom the &4&lSky Eden &6Book
- id:386
- amount:1
InventoryLocation: 5
Message: '&4You can now access this shop from the book'
PriceType: free
RewardType: permission
Reward:
- Boss.Arc
Back:
ExtraPermission: ''
MenuItem:
- name:&4Back to Main menu
- lore:Back to Main menu
- type:REDSTONE
- amount:1
InventoryLocation: 1
Message: ''
PriceType: free
RewardType: shop
Reward: Menu
Switch:
ExtraPermission: ''
MenuItem:
- name:&4Switch
- lore:To the Sell version of the shop
- id:51
- amount:1
InventoryLocation: 9
Message: ''
PriceType: free
Reward: ArcticShopS
RewardType: shop
Next:
ExtraPermission: ''
MenuItem:
- name:&6Next Page
- lore:Change Page
- id:339
- durability:1
- amount:1
InventoryLocation: 7
Message: ''
PriceType: free
Reward: ArcticShop8
RewardType: shop
Previous:
ExtraPermission: ''
MenuItem:
- name:&6Previous Page
- lore:Change Page
- id:339
- amount:1
InventoryLocation: 3
Message: ''
PriceType: free
Reward: ArcticShop64
RewardType: shop
Coal:
ExtraPermission: ''
MenuItem:
- id:263
- durability:0
- lore:$9.26
- amount:1
InventoryLocation: 10
RewardType: item
Reward:
- - id:263
- durability:0
- amount:1
PriceType: money
Price: 9.26
FireCharge:
ExtraPermission: ''
MenuItem:
- id:385
- durability:0
- lore:$43.53
- amount:1
InventoryLocation: 11
RewardType: item
Reward:
- - id:385
- durability:0
- amount:1
PriceType: money
Price: 43.53
Ice:
ExtraPermission: ''
MenuItem:
- id:79
- durability:0
- lore:$12.5
- amount:1
InventoryLocation: 12
RewardType: item
Reward:
- - id:79
- durability:0
- amount:1
PriceType: money
Price: 12.5
PackedIce:
ExtraPermission: ''
MenuItem:
- id:174
- durability:0
- lore:$25
- amount:1
InventoryLocation: 13
RewardType: item
Reward:
- - id:174
- durability:0
- amount:1
PriceType: money
Price: 25
SnowBlock:
ExtraPermission: ''
MenuItem:
- id:80
- durability:0
- lore:$50.4
- amount:1
InventoryLocation: 14
RewardType: item
Reward:
- - id:80
- durability:0
- amount:1
PriceType: money
Price: 50.4
Snowtile:
ExtraPermission: ''
MenuItem:
- id:78
- durability:0
- lore:$14
- amount:1
InventoryLocation: 15
RewardType: item
Reward:
- - id:78
- durability:0
- amount:1
PriceType: money
Price: 14
Snowball:
ExtraPermission: ''
MenuItem:
- id:332
- durability:0
- lore:$12.6
- amount:1
InventoryLocation: 16
RewardType: item
Reward:
- - id:332
- durability:0
- amount:1
PriceType: money
Price: 12.6
and the expected result in the attachments
all the file names are in the cells A1 to GJ1 and all the content for those files are in the cells A2 to GJ2
i tested this code:
Code: Select all
Sub CopyCellTextToCalc
Doc = ThisComponent
oSheet=thiscomponent.getcurrentcontroller.activesheet
oCell = ThisComponent.getCurrentSelection()
TestoCella = oCell.String
Dim oDoc As Object
Dim oDocProperties(0) as new com.sun.star.beans.PropertyValue
oDoc = ThisComponent
oDocProperties(0).Name = "Hidden"
oDocProperties(0).Value = True
oDocDic = StarDesktop.loadComponentFromURL( convertToURL("C:\ArcticShop.yml") , "_blank", 0, oDocProperties() )
oText = oDocDic.getText()
oCursor = oText.CreateTextCursor()
oCursor.gotoEnd(False)
oText.insertString(oCursor, oCell.String & chr(13), false)
oDocDic.store
oDocDic.close(False)
End Sub
rem --------------------------------------------------------------------------
but it only add content to 1 file, i need something that create the file and the content in it, and do that for all the cells in the second row, with different filename for each