This is the csv file :
Foreign Exchange Rates as of 8 October 2019
Weighted-average Interbank Exchange Rate = 30.457 Baht/US Dollar
1. Average Counter Rates Quoted by Commercial Banks (Baht / 1 Unit of Foreign Currency)
Country|Currency|Average Buying Rates Sight Bill|Average Buying Rates Transfer|Average Selling Rates
UNITED STATES|USD|30.2012|30.2926|30.6505
UNITED KINGDOM|GBP|36.8800|37.0288|37.8966
EURO ZONE|EUR|32.9382|33.0509|33.7740
JAPAN (100 Yen)|JPY|27.8869|27.9956|28.7627
HONG KONG|HKD|3.8278|3.8453|3.9254
MALAYSIA|MYR|7.1135|7.1634|7.3764
SINGAPORE|SGD|21.7234|21.8029|22.3454
BRUNEI DARUSSALAM|BND|21.6083|21.7347|22.4104
PHILIPPINES|PHP|0.5733|0.5769|0.6004
INDONESIA (1000 Rupiah)|IDR|1.9917|2.0556|2.2800
INDIA|INR|0.3809|0.3994|0.4619
SWITZERLAND|CHF|30.1647|30.2677|30.9296
AUSTRALIA|AUD|20.0623|20.1339|20.8951
NEW ZEALAND|NZD|18.8161|18.8956|19.4940
CANADA|CAD|22.5353|22.6245|23.1661
SWEDEN|SEK|3.0193|3.0361|3.1114
DENMARK|DKK|4.4053|4.4255|4.5257
NORWAY|NOK|3.2791|3.2940|3.3790
CHINA|CNY|4.1799|4.2125|4.3309
Released on 8 October 2019
Code:
Sub LoadCSVFile
Dim CSVFileName As String : CSVFileName = "file:///home/User01/Downloads/ER_CSV1_2019-10-08.csv"
If Len(CSVFileName) > 0 Then
Dim FPrp(1) As new com.sun.star.beans.PropertyValue
FPrp(0).Name = "FilterName"
FPrp(0).Value = "Text - txt - csv (StarCalc)"
FPrp(1).Name = "FilterOptions"
FPrp(1).Value = "44,34,76,1,,0,false,true,true,false"
Dim oDoc As Object : oDoc = StarDesktop.loadComponentFromURL(CSVFileName, "_blank", 0, fileProps())
End If
End Sub
- The code imports a csv file to a brand new .ods file. Can you please tell me how to edit the code to import it to an existing sheet with a specific sheet name ?
- Can you please tell me how to import beginning from the 5th line of the csv file with delimiter ‘|’ ?