The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Emu48 Edit a CSV File
12-30-2021, 07:24 AM
Post: #1
Emu48 Edit a CSV File
Program: STORE
Checksum: # F2D8h
Size: 283 bytes
Purpose: Store a CSV file to a list after removing the line feed characters. The CSV file is a string.
Problem: The DO loop terminates when no more line feed characters are present in a substring. At this point position would be equal to zero. As expected, the last substring is not removed. I tried an IFTE structure to deal with this, however the program does not execute the false statement. The false statement was supposed to remove the last substring starting after the last line feed character.

On the Emu48: Edit → Load Object... → C:\File → All Files(*.*)
→ Choose file to open → Store the object in FILE → Execute STORE

FILE

"248,1529945.480,521921.773■
249,1530002.951,521922.245■
251,1530058.926,521921.687■
252,1530114.903,521923.001■
254,1530221.977,521924.059"

PNTS

{ }

STORE

<< FILE DUP SIZE 10
CHR 1 1 { } → file
size char start
position points
<<
DO file start
size SUB DUP char
POS DUP ROT 1 ROT
SUB points SWAP +
'points' STO DUP
'start' STO+
'position' STO
UNTIL position
0 ==
END points
'PNTS' STO
>>
>>

@ file - a CSV file stored in FILE
@ size - the SIZE of the CSV file
@ char - the line feed character, character 10
@ start - the start of the next substring after position
@ position - the position of a line feed character in file
@ points - a list of substrings

Any help with this program would be greatly appreciated!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Emu48 Edit a CSV File - MNH - 12-30-2021 07:24 AM
RE: Emu48 Edit a CSV File - MNH - 12-30-2021, 04:34 PM
RE: Emu48 Edit a CSV File - MNH - 12-30-2021, 10:30 PM
RE: Emu48 Edit a CSV File - DavidM - 12-31-2021, 10:54 AM
RE: Emu48 Edit a CSV File - MNH - 12-31-2021, 06:11 PM
RE: Emu48 Edit a CSV File - MNH - 01-01-2022, 04:41 AM
RE: Emu48 Edit a CSV File - DavidM - 01-04-2022, 03:48 PM
RE: Emu48 Edit a CSV File - MNH - 01-04-2022, 11:32 PM
RE: Emu48 Edit a CSV File - DavidM - 01-05-2022, 12:14 PM
RE: Emu48 Edit a CSV File - DavidM - 01-08-2022, 11:22 AM
RE: Emu48 Edit a CSV File - MNH - 01-08-2022, 04:41 PM
RE: Emu48 Edit a CSV File - MNH - 01-08-2022, 07:41 PM
RE: Emu48 Edit a CSV File - DavidM - 01-09-2022, 02:34 PM
RE: Emu48 Edit a CSV File - DavidM - 01-10-2022, 10:50 AM
RE: Emu48 Edit a CSV File - MNH - 01-09-2022, 08:39 PM
RE: Emu48 Edit a CSV File - rprosperi - 01-10-2022, 04:01 AM
RE: Emu48 Edit a CSV File - DavidM - 01-10-2022, 12:41 PM
RE: Emu48 Edit a CSV File - DavidM - 01-14-2022, 04:25 PM
RE: Emu48 Edit a CSV File - MNH - 01-15-2022, 07:34 PM
RE: Emu48 Edit a CSV File - MNH - 01-04-2022, 11:06 PM
RE: Emu48 Edit a CSV File - John Keith - 12-31-2021, 06:51 PM
RE: Emu48 Edit a CSV File - MNH - 12-31-2021, 07:58 PM
RE: Emu48 Edit a CSV File - MNH - 01-04-2022, 11:39 PM
RE: Emu48 Edit a CSV File - Eric Rechlin - 01-05-2022, 03:22 PM
RE: Emu48 Edit a CSV File - MNH - 09-04-2022, 09:56 PM



User(s) browsing this thread: 3 Guest(s)