Advertisement

09.10.2008 at 10:35AM PDT, ID: 23720176
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

Followup:  Using awk on flat file with variable # of lines in input record

Asked by rdavis777 in Microsoft Excel Spreadsheet Software, Miscellaneous Software, Miscellaneous Programming

This is a variation on my previous posted question, since the actual input file format is slightly
different from what we had initially anticipated, and the required output is also slightly different.

We receive a flat text file that we need to convert to a "\" delimited csv format.  
The "records" in the file have some fields that are always at the same # line
in the "record" and some that are not.  

The "record" always starts with a date, and there are no blank lines in the file.

So a "record" in this flat file looks like this:

Date      ... always the 1st line of the "record"
Author      ... always the 2nd line of the "record"
Title      ... always the 3rd line of the "record"
Descript1      ... first line of description is always 4th line of "record"
.
.   ... any number of description strings;
.       but there must be at least one description line
.
DescriptNN
Required Reading  ... fixed string "Required Reading" always in the "record"
<filenameA1>CLASS ... may or may not be present; if present, it will be terminated by "CLASS"
<filenameA2>LAB   ... may of may not be present; if present, it will be terminated by "LAB"
Optional          ... fixed string "Optional" always in the "record"
<filenameB1>CLASS ... may or may not be present; if present, it will be terminated by "CLASS"
<filenameB2>LAB   ... may of may not be present; if present, it will be terminated by "LAB"


Sample input file is:

12/30/07
Dr. J. Smith
Working with Genes
A short overview of Basic DNA.
Required prerequisite courses are mandatory.
Required Reading
<basic-dna.txt>LAB
Optional
<basic-dna.doc>CLASS
<basic-dna.pdf>LAB
1/10/08
Dr. J. Smith
Advanced Gene Therapy
This course requires knowledge of basic dna structures.
Also needed are pre-reqs: adv-bio, adv-physics.
Students are expected to attend all labs.
Required Reading
<Advanced-gene.txt>CLASS
<Advanced-bio.txt>LAB
Optional
<advanced-gene2.doc>CLASS
2/15/08
Dr. J. Smith
Preq Bio
Prequsite for other courses.
Required Reading
Optional
<prereq-bio.pdf>CLASS

The desired output is:  (each line starts with date; lines are not wrapped in output file)

12/30/07\Dr. J. Smith\Working with Genes\A short overview of Basic DNA\Required prerequisite courses are mandatory.\Must1=LAB=basic-dna.txt\Optional1=CLASS=basic-dna.doc\Optional2=LAB=basic-dna.pdf
1/10/08\Dr. J. Smith\Advanced Gene Therapy\This course requires knowledge of basic dna structures.\Also needed are pre-reqs: adv-bio, adv-physics.\Students are expected to attend all labs.\Must1=CLASS=Advanced-gene.txt\Must2=LAB=Advanced-bio.txt\Optional1=CLASS=advanced-gene2.doc
2/15/08\Dr. J. Smith\Preq Bio\Prequsite for other courses.\Optional1=CLASS=prereq-bio.pdf

The answer to my previous question no longer works for the sections that start with "Required Reading" and "Optional".

Again, this "conversion" process will be run on a Windows XP Pro workstation, which has a basic set of unix utilities installed from unixutls.sourceforge.net.   We would prefer NOT having to get into installing perl and/or other programming type languages.  We're hoping to do it this using the typical grep/awk/sed/tr/cut etc basic commands.

Any help out there?  Start Free Trial
[+][-]09.10.2008 at 12:06PM PDT, ID: 22441783

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.10.2008 at 12:51PM PDT, ID: 22442253

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.10.2008 at 01:34PM PDT, ID: 22442696

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.10.2008 at 06:50PM PDT, ID: 22445162

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.10.2008 at 06:58PM PDT, ID: 22445262

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Excel Spreadsheet Software, Miscellaneous Software, Miscellaneous Programming
Sign Up Now!
Solution Provided By: dmadole
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_Related_20080208