Sample Header Ad - 728x90

Extracting SMS data from a XML

-1 votes
3 answers
263 views
I have a large xml file of my SMS messages. I want to put them into an easily accessible csv format. I've been trying to extract the 'address', 'messageBody' and 'messageTime' sections specifically but with no luck.
11624297248761nullnullnullnull150447917504050Yeah mate let's do lunch and catch up.11629944007697nullnullnullnull150447917563330You going now mate
I've had minor success with:
SMS.xml | awk -F'address' '{print $2}'
But this only takes the first 'address' from the line, ignoring the others. Any ideas on how to get this data in to a readable csv format? Any help interpretting the number in the 'messageTime' section would be greatly appreciated too. EDIT: The actual xml file does have balanced open and close tags and is formatted properly. I have just included a small excerpt here.
Asked by Luke (1 rep)
Nov 2, 2022, 01:19 PM
Last activity: Nov 2, 2022, 03:02 PM