General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2003 Server
>>>>>I have a .txt file that has a few fields delimited by a ~
>>>>>
>>>>>What is the syntax to import that .txt file into a cursor (or a temp table) ??
>>>>
>>>>APPEND FROM should give you what you need (you can experiment with the WITH DELIMITER or WITH CHARACTER clauses).
>>>
>>>I tried this:
>>>
>>>APPEND FROM myfile.txt DELIMITED WITH '~'
>>>
>>>...but all I get is data in the 1st column (there are 14).
>>>
>>>same thing happens if I try this:
>>>
>>>APPEND FROM myfile.txt FIELDS column1, column2 delimited WITH '~'
>>
>>How about ... DELIMITED WITH CHARACTER ~ (note no quotes around the tilde)
>
>Interesting. So this fails:
>
>APPEND FROM myfile.txt FIELDS column1, column2 DELIMITED WITH '~'
>
>and this works:
>
>APPEND FROM myfile.txt FIELDS column1, column2 DELIMITED WITH CHARACTER
>
>Not sure what the heck the difference is....but whaaatever - it works. Thanks!
This is about the difference between delimiters and separators. Delimiters come in pairs and surround things, like quotes around a string. Separators, as their name suggests, separate things, like commas in a list.
APPEND FROM/COPY TO have some confusion about delimiters and separators. However, DELIMITED WITH CHARACTER always specifies a separator, which sounds like what you need.
Tamar
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only