problem in reading large data from serial monitor

hi everyone

i am having problem in reading a large amount of data from the serial monitor.

my input will be

6E 245 IDR 12:30 SCH TRJ 102 HYD 12:30 SCH G8 141 BOM 12:35 SCH 6E 179 BOM 12:40 SCH 9W 475 BOM 12:40 SCH CD 561 PNQ 12:50 SCH SG 488 BOM 13:00 SCH AI 156 DEL 13:15 SCH SG 3105 MAA 13:15 SCH SG 516 PNQ 13:30 SCH G8 286 DEL 13:35 SCH 6E 329 DEL 13:40 SCH UK* 847 DEL 13:45 SCH SG 171 DEL 14:05 SCH 6E 5924 BOM 14:05 SCH 9W 472 BOM 14:05 SCH 6E 345 BLR 14:10 SCH 6E 905 HYD 14:15 SCH 6E 634 CCU 14:30 SCH
AI 663 BOM 14:45 SCH I5* 775 DEL 14:50 SCH 6E 161 AMD 14:55 SCH

if i assign this data in the sketch then m able to display it on serial monitor, but when i need to read this amount of data from serial monitor it gives me problem

can anyone help me with this?

const byte numChars = 255;
char receivedChars[numChars];   // an array to store the received data

boolean newData = false;

void setup() {
    Serial.begin(9600);
    Serial.println("<Arduino is ready>");
}

void loop() {
    recvWithEndMarker();
    showNewData();
}

void recvWithEndMarker() {
    static byte ndx = 0;
    char endMarker = '\n';
    char rc;
   
    while (Serial.available() > 0 && newData == false) {
        rc = Serial.read();

        if (rc != endMarker) {
            receivedChars[ndx] = rc;
            ndx++;
            if (ndx >= numChars) {
                ndx = numChars - 1;
            }
        }
        else {
            receivedChars[ndx] = '\0'; // terminate the string
            ndx = 0;
            newData = true;
        }
    }
}

void showNewData() {
    if (newData == true) {
        Serial.print("This just in ... ");
        Serial.println(receivedChars);
        newData = false;
    }
}

Sending data is usually easier than receiving it because "you" are in control of Transmission.

Why not simply send the data in smaller packets? The receiving end probably won't even see the difference.

Oops... You are having Trouble "receiving". I saw the Serial.println and got off on the wrong track.

Ok, so what do you mean exactly with "i am having problem in reading"? Does it get cut off? Distorted?

YOU are in control of the serial data, as shown in your other thread. So YOU should know better than to jam all that data out with no packet markers. IF you were sending "<D: 6E 245 IDR 12:30 SCH>" or "<A: TRJ 102 HYD 12:30 SCH>", you could distinguish between arrival data and departure data AND you wouldn't have to read and store a bazillion characters.

One problem is that you have a 255 char buffer (good for 254 characters from the serial monitor) and you're sending 496 characters (based on copying your data to notepad++ and counting) before you send a '\n'.