How to get the serial monitor to only show a specific part of what it outputs?

I am trying to get the serial monitor to only show the last line (before disconnecting) in the serial monitor so that I can generate an if statement with this data.

This is the output I am currently getting :

connecting...
connected
HTTP/1.1 200 OK
Server: Apache
Cache-Control: max-age=172800
Expires: Sat, 26 Apr 2014 21:04:47 GMT
Host-Header: 192fc2e7e50945beb8231a492d6a8024
Vary: Accept-Encoding
Content-Type: text/html
X-Url: /test1/twittermention.php
X-Host: www.jayclark.co.uk
Content-Length: 18
Accept-Ranges: bytes
Date: Thu, 24 Apr 2014 21:04:48 GMT
Connection: close
X-Forwarded-For: 77.98.245.196
X-Cache: SGCACHE-MISS

459321248800313344
disconnecting.

I only need the '459321248800313344' to show.

Anyone got any ideas??

Thanks a lot for your time in advance guys!

I would count the number of carriage returns, and the when you have the right number gather the data you want.

What code would you recommend me to use to get the Serial.print to only print from a certain point?

Serial.println("459321248800313344");

That is not the real answer, of course, but as you didn't post any of your code I had to make up my own.

Where is the serial output coming from in your program ?
Is the format fixed ?

I recommend C code.

That is all I can do with the very poor information you have provided so far.

i guess commenting out all the other Serial.print and Serial.println isn't a good idea?
8)

sorry here is the code I am using

/*
  Web client
 
 This sketch connects to a website (http://www.google.com)
 using an Arduino Wiznet Ethernet shield. 
 
 Circuit:
 * Ethernet shield attached to pins 10, 11, 12, 13
 
 created 18 Dec 2009
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe, based on work by Adrian McEwen
 
 */

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
char server[] = "www.jayclark.co.uk";    // name address for Google (using DNS)

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192,168,0,1);

// Initialize the Ethernet client library
// with the IP address and port of the server 
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
  }
  // give the Ethernet shield a second to initialize:
  delay(1000);
  Serial.println("connecting...");

  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("connected");
    // Make a HTTP request:
    client.println("GET /test1/twittermention.php HTTP/1.1");
    client.println("Host: www.jayclark.co.uk");
    client.println("Connection: close");
    client.println();
  } 
  else {
    // kf you didn't get a connection to the server:
    Serial.println("connection failed");
  }
}

void loop()
{
  // if there are incoming bytes available 
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();

    // do nothing forevermore:
    while(true);
  }
}
if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

Here you are reading bytes from the client. As well as printing them out test to see if they are a CR, if so increment the CR count.
When it gets to the right number ( as found from counting how many lines you have before it finishes ) start saving the variable c in an char array. This is then the data you want.

right ok I will have a look at that and try to get it working. Could I possibly use the 'trim' unction in this instance?

If you gather the data at the right time you will not need trim.
Having just one big array and trimming it down would use too much memory.

You could modify your php script to not output all that crap. None of mine do.

I suggest that you read up on the HTTP protocol. Sounds like to want to access the document returned by your HTTP request, but you are printing out all the HTTP headers. BTW the content type is not text/html, try text/plain.

Some old code modified to extract the number line from the header lines.

//zoomkat 12-22-10
//simple ethernet client test code
//for use with IDE 0021 and W5100 ethernet shield
//modify the arduino lan ip address as needed
//open serial monitor to see what the arduino receives
//push the shield reset button to run client again

#include <SPI.h>
#include <Ethernet.h>
String readString, readString1;
int x=0;
char lf=10;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
//byte ip[] = { 192, 168, 1, 102 };
//byte server[] = { 140, 90, 238, 27 }; // NOAA
char serverName[] = "www.jayclark.co.uk";

EthernetClient client;

void setup()
{
  Ethernet.begin(mac);
  Serial.begin(9600);
  Serial.println("starting simple arduino client test");
  Serial.println();
  Serial.println("connecting...");

  if (client.connect(serverName, 80)) {
    Serial.println("connected");
    client.println("GET /test1/twittermention.php HTTP/1.1");
    client.println("Host: www.jayclark.co.uk");
    client.println("Connection: close"); 
    client.println();
  } else {
    Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available()) {
    char c = client.read();
    //Serial.print(c);  // uncomment to see raw feed
    if (c==lf) x=(x+1);
    if (x==16) readString += c;
    //readString += c;
  }

  if (!client.connected()) {
     client.stop();

    Serial.println("Current data row:" );
    Serial.print(readString);
    Serial.println();
    //readString1 = (readString.substring(41,43));
    //Serial.println();
    //Serial.print("DPD sec: ");
    //Serial.println(readString1);
    Serial.println("done");

    for(;;);

    }
 }