Computing.Net > Forums > Programming > Extract date from lines

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Extract date from lines

Reply to Message Icon

Name: gsurfer
Date: November 13, 2007 at 02:17:55 Pacific
OS: XP SP2
CPU/Ram: P4/ 1GB
Product: Fujitsu
Comment:

If somebody could help with this one please.
I have a file that looks like this:

name;ip;ip;gateway;mac;virtyal;date;time
name;dhcp;ip;ip;ip;gateway;mac;virtyal;date;time
name;ip;ip;gateway;mac;virtyal;date;time

It is real data, I just put ip to save space. As you can see not all the rows are the same, some are spread over two lines and there is about 300 rows.
Now I need to extract server name, only the first ip, mac address and word virtual.
Somebody have helped me earlier on with this file but this is different requirement now that I found very difficult to do.
Any help much appreciated.

gSurfer



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: November 13, 2007 at 18:34:41 Pacific
Reply:

As you can see not all the rows are the same, some are spread over two lines and there is about 300 rows.

So basically, you have a lot of data, with no exploitable pattern (or any pattern, for that matter), and you want a script to parse it?


0

Response Number 2
Name: gsurfer
Date: November 14, 2007 at 00:01:08 Pacific
Reply:

Hi
The difference between rows are that some have word "dhcp" in them and others dont and some 3 ip and others 4 ip adressess,that is the reason some are on two lines, othervise they are the same. I dont know if vb script can extract data using colomns, I can insert header for each row.

gSurfer


0

Response Number 3
Name: gsurfer
Date: November 14, 2007 at 00:19:32 Pacific
Reply:

Just went throught file again.
What actualy will help me if somebody can help me with the code to go throught text and delete one ip between 3rd and fourth tab delimiters if word dhcp is in the line.
That would sort the rest of it, I hope.
Thank you.

gSurfer


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Extract date from lines

Extracting rows from pipe delimited file www.computing.net/answers/programming/extracting-rows-from-pipe-delimited-file/19338.html

For and extracting nums from text www.computing.net/answers/programming/for-and-extracting-nums-from-text/11600.html

Extracting data from an array in C www.computing.net/answers/programming/extracting-data-from-an-array-in-c/8130.html