Hi,
Please I am a beginner in java, I want to extract information from a text file. is the following:
============================================
============================================From: 55555565
From_SMSC: 78987555
Sent: 00-02-21 22:26:23
Received: 00-02-21 22:26:29
Subject: modem1
Alphabet: ISO
UDH: false
pr2
I want to extract the first line which is exactly the number " 55555565 " and the last line is "pr2".
for now I just use the code that allows me to extract only the last line"pr2".
++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++Scanner scanner = new Scanner(new File(/home/Desktop/ivw.txt)); String line = null; while (scanner.hasNextLine()) { line = scanner.nextLine(); } readSMS=line; scanner.close();
I want to retrieve information both the first line and the last line so that I can put each in a variable.
thank you for your help