Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help on Append From Command
Message
From
13/10/2017 13:32:55
 
 
To
13/10/2017 12:49:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01654964
Message ID:
01654965
Views:
59
>Respected Sir,
>
>I have a Text file in which Data is like This
>
>
>%%Pages: 1 1
>/p { moveto 0 1 rlineto 1 0 rlineto 0 -1 rlineto fill } bind def 2 2 scale 76 116 p 77 116 p 78 116 p 79 116 p 80 116 p 81 116 p 82 116 p 87 116 p 88 116 p 90 116 p 91 116 p 92 116 p 94 116 p 95 116 p 99 116 p 101 116 p 103 116 p 106 116 p 107 116 p 110 116 p 111 116 p 112 116 p 113 116 p 114 116 p 115 116 p 116 116 p
>
>
>I am using the following commands
>
>
>Create Cursor QRcode (Targeturl Varchar(254))  && Create Temporary Cursor Qrcode 
>Append from (1.Txt )Type SDF
>
>
>But since the width of my cursor is Maxumum 254 the Data is lost and I need Data in my cursor as
>
>
>%%Pages: 1 1
>/p { moveto 0 1 rlineto 1 0 rlineto 0 -1 rlineto fill } bind def 2 2 scale 76 116 p
>77 116 p
>78 116 p
>79 116 p
>80 116 p
>81 116 p
>82 116 p
>
>
>I.e after every 'p' I need to add record. After the records will be added properly I will change the column position i.e value of 116 (Digit Just before p) to some other value as required.
>
>Kindly guide how to append records in the above case, is there any other easy less time consuming way of changing value in the string at once without appending records in cursor and going through the process of Scan-Endscan and re-writing the entire file with new values (i.e the numeric value just before every 'p')
>
>Thanks

If we were to assume that "116" only appears in the places where you want to change, and that there is only one space between the "116" and the "p", then perhaps something like:
cOorg = FILETOSTR("old.txt")
cNew = STRTRAN(m.cOrg," 116 p"," 456 p")
= STRTOFILE(m.cNew,"new.txt")
might work (this example reads file "old.txt", replaces the "116" with "456" and writes the result to "new.txt") ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform