Advertisement

05.17.2006 at 10:40PM PDT, ID: 21854851
[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!

8.4

Simply awk/sed solution required - Split a file on fields - another additional question

Asked by glennstewart in Unix Systems Programming

Tags: , , , ,

Hi All,

A nice easy one being an extension of two previously answered questions. Should be nice easy points up for grabs.

For reference see the following two PAQ's:

First Question:
http://www.experts-exchange.com/Programming/Programming_Platforms/Unix_Programming/Q_21763311.html
Second Question:
http://www.experts-exchange.com/Programming/Programming_Platforms/Unix_Programming/Q_21764891.html

The input is ever so slightly different, and the output required is ever so slightly different.
Ozo's answer from the second PAQ is great - it works.

So can base off this or re-work if you like.

------------------------------------------
INPUT ATTRIBUTES:

* Text file to be split into multiple files
* Delimeters start with two consecutive pipes and consist of 7 pipes

DELIMITER EXAMPLES:

a) ||XX|123456|A111|||
b) ||XX|123456|A111|0212345678||
c) ||XX|123456|A111|(02) 12345678||
d) ||XX|123456|A111|(02) 12345678|test@email.com|

a) The first example are the only compulsory fields
XX=company code
123456=booking which could be 5 or 6 digits
A111=series which is letter and number combo

b) Also contains a phone number

c) The phone number can contain spaces and brackets

d) Also can contain email address

AIM:

* To convert text file into multiple text files based on file names above
* Filenames should be unique
* Filenames should unclude YYYYMMDD_HHMM to ensure uniqueness
* Files produced should maintain the pipe delimiter as line number one
* Junk text found in file prior to first pipe should be discarded

INPUT FILE EXAMPLE:
VVVVVVVVVVVVVVVVVVVVVVVVVV
Possible junk text to be discarded
||AA|111111|E123|||
Contents of file one
||XX|222222|A111|(02) 12345678||
Contents of file two
||XX|222222|A111|0212345678||
Contents of file three
^^^^^^^^^^^^^^^^^^^^^^^

OUTPUT FILES PRODUCED:

AA111111_20060518_1614_001.DOC
XX222222_20060518_1614_002.DOC
XX222222_20060518_1614_003.DOC

NOTE:

AA111111_20060518_1614_001.DOC would contain:
VVVVVVVVVVVVVVVVVVVVVVVVVV
||AA|111111|E123|||
Contents of file one
^^^^^^^^^^^^^^^^^^^^^^^

Thanks in advance,Start Free Trial
[+][-]05.18.2006 at 04:08AM PDT, ID: 16707315

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.

 
[+][-]05.18.2006 at 03:20PM PDT, ID: 16713504

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.

 
[+][-]05.18.2006 at 11:15PM PDT, ID: 16715447

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.

 
[+][-]05.19.2006 at 04:42AM PDT, ID: 16717056

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

Zone: Unix Systems Programming
Tags: split, awk, sed, file, unix
Sign Up Now!
Solution Provided By: ahoffmann
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.22.2006 at 11:39PM PDT, ID: 16740180

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.

 
[+][-]05.22.2006 at 11:52PM PDT, ID: 16740232

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.

 
[+][-]05.23.2006 at 12:01AM PDT, ID: 16740272

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.

 
[+][-]05.23.2006 at 02:38AM PDT, ID: 16740828

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.

 
[+][-]05.23.2006 at 06:45AM PDT, ID: 16742336

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.

 
[+][-]05.23.2006 at 07:36AM PDT, ID: 16742757

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.

 
 
Loading Advertisement...
20081112-EE-VQP-42