Ultimately, this comes from a series of files which are one news story each.
A typical news story looks like this:
Document 4 of 6
Ours is a manufacturing province:[Final Edition]
Edmonton Journal. Edmonton, Alta.:Jan 2, 2002. p. A12
Document types: Business; Editorial
Section: Opinion
Publication title: Edmonton Journal. Edmonton, Alta.: Jan 2, 2002. pg. A.12
Source type: Newspaper
ProQuest document: 221806441
Text Word Count 559
Document URL:
http://proquest.umi.com/
pqdweb?did=221806441&Fmt=3&clientId=14119&RQT=309&VName=PQD
Abstract (Document Summary)
The tax load on manufacturers in Edmonton is the lowest of all cities in North
America, according to a com ison by ICF Economic Consulting Group of San
Francisco, in a study for Economic Development Edmonton.
The EDE survey discovered that 80 per cent of advanced manufacturing companies
in Edmonton were founded here. So our city's economic growth may depend more
upon encouraging local entrepreneurs than upon attracting businesses from
elsewhere.
Allan Scott, EDE's incoming president, promises to pursue venture capital and
has suggested that small amounts of provincial or municipal government funds
might reasonably go into high-risk, high- return venture portfolios.
Full Text (559 words)
Copyright Southam Publications Inc. Jan 2, 2002
Premier Ralph Klein has accurately recognized the importance of manufacturing
to Alberta's economy.
Too often, we assume that our province depends only on energy prices, inviting
complacency when they are high, and gloom when they are low -- as they are now.
If prices stay low, "the only way we can make up the difference is if there is
a strong movement in the manufacturing sector," Klein said in a year-end
interview.
Fortunately, that sector has grown steadily over the past three decades.
Alberta manufacturing shipments have risen from $1.9 billion to $32.8 billion
from 1970 to 1998.
*************************
I'm at the stage where I'm extracting information into files to put into an excel spreadsheet. I received help from someone else in another thread and settled on using the egrep command. I would go through each file, and egrep the line that started with "ProQuest Document ID" and output that to a separate file. Then, I would egrep again and seek every line that started with, say, Publication title and output that to a different file. Then, I would import both into excel, and line both columns up so that the ProQuest Document ID line matched up with the *corresponding* publication title information in the next column.
That actually worked pretty well for most fields of data that I'm interested in. However, some of the fields that I'm interested in (Section and Document types) in particular, <b> do not appear in each file</b>. Therefore, my technique of egrepping each line wouldn't work, because not every file would have a line to egrep.
I compromised and developed an awk command:
awk ' BEGIN { FS = ":" } ; /^Document.types|^ProQuest document/ { print $2 } ' * >> ~/documents/dissertation/con/prime/newfile.txt
and that is how I got the column of data above. i was hoping to find a way then, to split the column into three columns where the data would nicely line up. However, I'm seeing this might be difficult.
Any suggestions that would work either with this column of data that I have here, or with the original news stories would work. I.e. I'd like to get the fields: ProQuest Document ID; Document Types; Section; and print them <b> in rows</b> - one row for each file - and not in a column.
By the way, I'm aware that some people may be frustrated with me as I hav eposted a numbber of times on the same project. Please understand, this my very first foray into programming and, for whatever it's worth, I have learned a shitload about unix and I'm getting much more independent at it. But I'm not ready to take the training wheels off just yet. Simple or annotated, explained scripts are welcome!