Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Splitting REALLY *REALLY* long lines into single character + CR + LF
#5
(04-22-2025, 04:34 AM)Circlotron Wrote: I am trying to work with a text file of pi that is one single line of one *billion* digits. QB64 Phoenix doesn't seem to like putting this one long line into a string variable. It just sits there with one CPU maxed out. Maybe it might do something eventually, but not in any reasonable time frame.

Is there an easy way using Linux to convert this long line into a file in the following format?

3
.
1
4
1
5
9

etc?

That should make it much easier to deal with.
While we are at it, what is the maximum size file that can be opened for reading?





I don't think there is a practical maximum on NTFS or EXT4 file systems.   On FAT32 the largest file that can exist is 4gb's  


I would just grab that file into a Byte Array.     
DIM NUMBYTES AS _UNSIGNED _INT64

OPEN "PIFILE" FOR BINARY AS #1
NUMBYTES = LOF(1)
REDIM PIARRAY(0 TO NUMBYTES-1) AS _UNSIGNED _BYTE

GET #1,, PIARRAY()



'  That part gets the file.    If PI is an ASCII string then you can determine the place value of each digit by subtracting 48 from the Byte value.

PIARRAY(1) should be the decimal point IF the file has no leading spaces.
Reply


Messages In This Thread
RE: Splitting REALLY *REALLY* long lines into single character + CR + LF - by ahenry3068 - 04-22-2025, 06:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Lines of Code bplus 20 3,052 01-25-2025, 05:11 PM
Last Post: Pete
  very long pathnames and _DirExists (prob ?) doppler 2 818 12-31-2023, 05:04 PM
Last Post: doppler
  Integer (math) Single = Single SMcNeill 0 544 10-20-2023, 12:16 AM
Last Post: SMcNeill
  tweak Str$ for single and double Jack 9 1,757 12-01-2022, 03:51 PM
Last Post: Pete
  Reading a single value from Registry (Win) euklides 1 684 06-06-2022, 02:41 PM
Last Post: euklides

Forum Jump:


Users browsing this thread: 1 Guest(s)