The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unable to display correctly the contents of a file without a line feed Gato Shell Programming and Scripting 1 07-17-2008 05:23 PM
Deleting access_log.processed in crontab chickenhouse UNIX for Dummies Questions & Answers 4 07-01-2008 11:19 PM
Is grep being used correctly? sai0899 Shell Programming and Scripting 2 04-18-2008 01:03 AM
HP-UX will not boot correctly intern UNIX for Dummies Questions & Answers 5 05-24-2006 09:19 AM
Couldn't set locale correctly mattd UNIX for Dummies Questions & Answers 1 02-10-2004 05:11 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-07-2008
BartleDuc BartleDuc is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 1
Awk: first line not processed correctly

Hey,

I've made a little awk-script which reorders lines.
Works okay, only problem is that is doesn't process the first line correctly.
If I switch lines in the Input file it doesn't proces this first line either.

Somebody please help!

Here's is the code and the input file!

thanx



Code:
awk 'FS=","{print $1","$2","$3","$4","$5","$6","$7","$8","$9";xf="$11";yf="$
12";,"$10}' Input > Output


Code:

Input
1,2,0,0,6,43,5,0,p1=Gmünd;p2=Austria;p8=Bad Großpertholz;fc=4,,1473937,4855256,1
2,3,0,0,6,43,5,0,p1=Gmünd;p2=Austria;p8=Bad Großpertholz;fc=4,Güterweg Gugu,1473760,4855398,2
2,4,0,0,6,43,5,0,p1=Gmünd;p2=Austria;p8=Bad Großpertholz;fc=4,,1473760,4855398,2


Code:
Output
1,2,0,0,6,43,5,0,p1=Gmünd;p2=Austria;p8=Bad,Großpertholz;fc=4,,1473937,4855256,1,,,,,,,;xf=;yf=;,
2,3,0,0,6,43,5,0,p1=Gmünd;p2=Austria;p8=Bad Großpertholz;fc=4;xf=1473760;yf=4855398;,Güterweg Gugu
2,4,0,0,6,43,5,0,p1=Gmünd;p2=Austria;p8=Bad Großpertholz;fc=4;xf=1473760;yf=4855398;,

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0