Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
litLIB: Added optional parameters to csv (Read 2731 times)
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
litLIB: Added optional parameters to csv
17.12.09 at 16:13:17
litLIB: Added optional parameters to csv
Three optional parameters were added to the csv function. The csv function can retrieve comma separated data from a file, the web or from a string (cell value or literal) and display the fields each in a separate cell.
Sorting a CSV file before displaying it will be handy as the usual Excel sort will not work on the formulas. What will work is when first using the CSV data to make the Excel table, then to copy and paste values. After that the Excel sort will work fine.
Using the new SortByCol parameter you can give the column number on which to perform a sort. The SortMode parameter (also added) will indicate whether you want to do an ascending sort (default = 0) or a descending sort (1).
A last optional parameter was added: Skip. Some csv data come with a header. Either a some notice, column headers or both. In any case it may be handy to be able to skip a few lines before starting to parse the CSV data. Using the Skip parameter you indicate how many lines to skip (default 0).
With these changes the new syntax for the CSV function becomes:
=csv(Source [, SourceType, Delimiter, Skip, SortByCol, SortMode ] )


Get csv data from a file, sorting by column 1 ascending
Get csv data from the web skipping 5 lines
=csv("\getcsv", "http",5)  
See also:
CSV function
Back to top
« Last Edit: 17.12.09 at 16:13:28 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1