I have tables embedded in pure text files. I am trying to extract these tables of data and generate structured tables. the test files i am using do not embed tags or special delimiters, just uneven space.
text file example:
---------------------------------------------------------
X is the x axis defined as ............
Y is the iiiii
the area XY is the integral of ......
several points on line are as follows
X Y Z
------ ----- ------
a 1.2 3 2
b 3 2.2 11
c 4 1.2 2.1
a and b represent the base
however c may represent ..........
---------------------------------------------------------
how would i be able just to extract
X Y Z
------ ----- ------
a 1.2 3 2
b 3 2.2 11
c 4 1.2 2.1
from the text file?
any suggestions?
Thanks
extracting table from text files
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2229
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Easy, just use EasyPatterns:
Search for:
[ capture( 1+ not space ), ' ',
capture( 1+ not space ), ' ',
capture( 1+ not space ), ' ',
....etc...
]
Replace with:
$1,$2,$3,$3
Search for:
[ capture( 1+ not space ), ' ',
capture( 1+ not space ), ' ',
capture( 1+ not space ), ' ',
....etc...
]
Replace with:
$1,$2,$3,$3
Regards,
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads