Sponsored Content
Full Discussion: awk Command "HELP ME"
Top Forums UNIX for Dummies Questions & Answers awk Command "HELP ME" Post 302900805 by newme85 on Thursday 8th of May 2014 07:59:13 PM
Old 05-08-2014
awk Command "HELP ME"

Hello everyone, i'm working on this project with a friend and we decided to split the project in half and i got the awk half (GREAT). so i have a list of states and people and i'm trying to write a command that will make end result look like this

California
Jenilee Harrison, San Francisco
Sam Karter, Los Angeles
Minnie Mouse, Anaheim
Florida
Gandalf Addison, Jupiter
Mickey Mouse, Orlando
Tawanda Rice, West Palm Beach
Adam Voter, Miami
Gollum Zeller, Tampa
Illinois
Zelda Bosco, Chicago
Milton Callahan, Schaumburg
Howard Messer, Orland Park
Ogden Nash, Berkeley
Penelope Ogden, Naperville
Indiana
Dominique Daniels, Gary
Susie Green, Indianapolis
Harvey Pelican, Michigan City
Byron Trapp, Indianapolis
Wisconsin
Vickie Edison, Milwaukee
Tom Furter, Milwaukee
Dave Ile, Madison
Waylon Jetson, Green Bay
Kendall Smith, Madison


I thought it would be fairly easy but i'm running into problems....this is what i have....

BEGIN { FS = "|" }
{ printf "%-40s %-20s %6.2f\n", $1, $2, $3, $4 }

but nothing happens

---------- Post updated at 06:59 PM ---------- Previous update was at 06:56 PM ----------

forgot to add what the files look like before


Florida:Mouse:Mickey:Orlando
California:Mouse:Minnie:Anaheim
Florida:Voter:Adam:Miami
Illinois:Bosco:Zelda:Chicago
Indiana:Green:Susie:Indianapolis
Wisconsin:Furter:Tom:Milwaukee
Wisconsin:IleSmilieave:Madison
California:Karter:Sam:Los Angeles
Illinois:Messer:Howard:Orland Park
Illinois:Nash:Ogden:Berkeley
Illinois:Ogden:Penelope:Naperville
Indiana:Pelican:Harvey:Michigan City
Florida:Rice:Tawanda:West Palm Beach
Wisconsin:Smith:Kendall:Madison
Indiana:Trapp:Byron:Indianapolis
Illinois:Callahan:Milton:Schaumburg
IndianaSmilieanielsSmilieominique:Gary
Wisconsin:Edison:Vickie:Milwaukee
Florida:Addison:Gandalf:Jupiter
Florida:Zeller:Gollum:Tampa
California:Harrison:Jenilee:San Francisco
Wisconsin:Jetson:Waylon:Green Bay
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

help for saving vertical datas to horizontal with "awk" or "cut"

hi, i have a file having datas like that ./a.txt 12344 12345 12346 12347 ..... ..... ... i want to save this datas to another file like that ./b.txt 12344 12345 12346 12347 ... ... ... i think awk can make this but how? :) waiting for ur help. (3 Replies)
Discussion started by: mercury
3 Replies

3. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

4. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

5. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

6. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

7. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

8. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

9. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

10. Shell Programming and Scripting

awk "date" and "system" command

Hello experts! I need your help please I have a file.txt of which I want to extract 3rd and 4th columns with date with the form e.g.: 2016-11-25 03:14:50and pass them to "date" command, but also append the 9th column in a file as well. So I want to execute date -d '2016-11-25 03:14:50' ... (2 Replies)
Discussion started by: phaethon
2 Replies
condor_rmdir(1) 					      General Commands Manual						   condor_rmdir(1)

Name
       condor_rmdir Windows - only no-fail deletion of directories

Synopsis
       condor_rmdir [/HELP | /?]

       condor_rmdir@filename

       condor_rmdir[/VERBOSE] [/DIAGNOSTIC] [/PATH:<path>] [/S] [/C] [/Q] [/NODEL] directory

Description
       condor_rmdircan delete a specified directory, and will not fail if the directory contains files that have ACLs that deny the SYSTEM process
       delete access, unlike the built-in Windows rmdircommand.

       The directory to be removed together with other command line arguments may be specified within a file named filename, prefixing this  argu-
       ment with an  @ character.

       The  condor_rmdir.exeexecutable is is intended to be used by Condor with the /S/Coptions, which cause it to recurse into subdirectories and
       continue on errors.

Options
       /HELP

	  Print usage information.

       /?

	  Print usage information.

       /VERBOSE

	  Print detailed output.

       /DIAGNOSTIC

	  Print out the internal flow of control information.

       /PATH:<path>

	  Remove the directory given by <path>.

       /S

	  Include subdirectories in those removed.

       /C

	  Continue even if access is denied.

       /Q

	  Print error output only.

       /NODEL

	  Do not remove directories. ACLs may still be changed.

Exit Status
       condor_rmdirwill exit with a status value of 0 (zero) upon success, and it will exit with the standard HRESULT error code upon failure.

Author
       Condor Team, University of Wisconsin-Madison

Copyright
       Copyright (C) 1990-2012 Condor Team, Computer Sciences Department, University of  Wisconsin-Madison,  Madison,  WI.  All  Rights  Reserved.
       Licensed under the Apache License, Version 2.0.

       See the Condor Version 7.8.2 Manualor http://www.condorproject.org/licensefor additional notices. condor-admin@cs.wisc.edu

								  September 2012						   condor_rmdir(1)
All times are GMT -4. The time now is 11:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy