Solved

Help with awk or similar

Posted on 2006-11-14
1
196 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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