Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help on Append From Command
Message
 
À
13/10/2017 13:39:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01654964
Message ID:
01654969
Vues:
49
Following Naoto's idea, would this work?
cOrg = FILETOSTR("old.txt")
cNew = STRTRAN(m.cOrg, " p ", " p" + CHR(13) + CHR(10))
= STRTOFILE(m.cNew,"new.txt")
In other words, wrap the lines into a new txt file, then append.


>>>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") ?
>
>The value 116 is not fixed.It is column position so some where it will be 116 and at another it may be different. I need what ever may be the value (it may be 116 or 126 or what ever, the value to be replace by 116+20 or 116+30). etc. Thats why I was looking for breaking it into records.
>
>Can the code you have given can be altered to suit my requirement, because it seems to be fast vis a vis what i am planning to do
>
>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform