PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Wx - Importar arquivo CSV - Procedure WS_ImportCSV
Wx - Importar arquivo CSV - Procedure WS_ImportCSV
Started by adrianoboller, Aug., 28 2015 8:36 PM - No answer
Connect yourself…
adrianoboller
#1
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on August, 28 2015 - 8:36 PM
Procedure
WS_ImportCSV
(
s
FullFileName is
string
)
s
CsvSeparator is
string
=
";"
s
CsvRow is
string
n
FileNum is
int
n
Loop
,
Total is
int
n
Col is
int
n
JumCol is
int
=
1
// Create a Table Control with the sufficient (more) column
//TableDeleteAll(TABLE_Table1)
n
FileNum
=
fOpen
(
s
FullFileName
,
foRead
)
IF
n
FileNum
= -
1
THEN
Error
(
"File not found!"
)
ELSE
LOOP
s
CsvRow
=
fReadLine
(
n
FileNum
)
n
Col
=
1
Total
=
Length
(
s
CsvRow
)
FOR
n
Loop
=
1
TO Total
IF
s
CsvRow
[
[
n
Loop
]
] =
s
CsvSeparator
THEN
s
CsvRow
[
[
n
Loop
]
] =
TAB
n
Col
+
+
END
END
Info
(
s
CsvRow
)
//TableAdd(TABLE_Table1,sCsvRow)
IF
s
CsvRow
=
EOT
THEN BREAK
END
fClose
(
n
FileNum
)
END
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text