Solved

Help with awk or similar

Posted on 2006-11-14
1
195 Views
Last Modified: 2010-04-22
Hi, I'm a little rusty with awk scripting...here's what I'm trying to do...given this data file...

A92733
   FullName,Murthy, Anne
   AccountType,User
   LastLogonTime,11/14/2006 9:01 AM
A93779
   FullName,Smith, Alex
   AccountType,User
   LastLogonTime,11/14/2006 9:01 AM

...I would like a script that creates a separate file for each account number (the account number would be the file name) which would contain the corresponding data FullName etc.
0
Comment
Question by:veedar
1 Comment
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 17941392
awk '{if (((NR - 1) % 4) == 0) {FileName=$0} else {print > FileName}}' YourDataFileName
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now