Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File to str - I need a carriage return
Message
 
To
15/10/2014 02:54:38
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01609388
Message ID:
01609392
Views:
33
>>I have created a dbf with a number of records each containing a long memo field with a long string - there are 2 types of records A and B
>>
>>When I convert this to a text file using file to string I need all B records to have a carriage return at the end of that line in the text file
>>
>>How can I do this
>>
>>I don't need a line feed character as well
>>
>>Thanks
>
>This is a bit a to wide question
>assuming you will remember the CRLF discussion of yesterday.
>
>
>SELECT yourTable
>lcx = "" &&initial
>SCAN FOR [expression that filters out record b]
> TEXT to lcx TEXTMERGE NOSHOW ADDITIVE
><<field1>>,sometconstant <<fieldn>>
>
> ENDTEXT
>ENDSCAN
>STRTOFILE(lcx,YourFileName)
>
>*or within the scan anything else that will build the string, we had examples yesterday.
>
>
>other version
>
>SELECT yourTable
>COPY TO YourFileName FOR [expression that filters out record b] TYPE SDF
>*or
>COPY TO YourFileName FOR [expression that filters out record b] TYPE CSV
>
>
>also look for TYPE DELIMITED in the help
>
>or
>
>SELECT;
> Cur1.*;
> FROM YoruTable AS Cur1;
> TO FILE YourFileName;
> WHERE [expression that filters out record b]
>
>
>thats not all possible, but it's a start.
>
>I while sooner or later need to move to some SQL Server anyway. would do something like
>
>*could be replaced for SQL Server w/o changing te cursor
>SELECT;
> Cur1.*;
> FROM YoruTable AS Cur1;
> INTO CurOutPut;
> WHERE [expression that filters out record b]
>
>*this might be in some function that itself coud be replaced and be generic or what ever
>lcx = "" &&initial
>SCAN FOR [expression that filters out record b]
> TEXT to lcx TEXTMERGE NOSHOW ADDITIVE
><<field1>>,sometconstant <<fieldn>>
>
> ENDTEXT
>ENDSCAN
>*or something similar
>
>*final write
>STRTOFILE(lcx,YourFileName)
>
>This gives fine control over the output.
>
>Lutz

Sorry I made a mistake - all records need the carriage return

Is there now a simple way of doing this?

Thanks for your help
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform