Emu48 Edit a CSV File
|
12-30-2021, 10:30 PM
Post: #3
|
|||
|
|||
RE: Emu48 Edit a CSV File
Edit
Program: STORE Checksum: # C5C6h Size: 393 Purpose: Removes the line feed characters from a CSV string, and stores individual strings in the form of point number, northing, and easting into a list named PNTS. Problems: None! The programs works as expected. << { } 'PNTS' STO FILE DUP SIZE 10 CHR 1 1 << SUB PNTS SWAP + 'PNTS' STO >> → file size char start position Store << DO file start size SUB DUP char POS DUP 0 == << file start size Store EVAL 0 'position' STO 2 DROPN >> << DUP ROT 1 ROT 2 - Store EVAL DUP 'start' STO+ 'position' STO >> IFTE UNTIL position 0 == END >> >> @ file - local variable, a CSV file stored in FILE @ size - local variable, the SIZE of the CSV file @ char - local variable, the line feed character, character 10 @ start - local variable, the start of the next substring after position @ position - local variable, the position of a line feed character in file @ Store - subroutine, stores resultant strings @ Resulting list of strings. { "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" } |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)