UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 29th, 2005, 05:48 PM
smokingguns smokingguns is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 16 smokingguns User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 35 m 4 sec
Reputation Power: 0
auto generation of files using awk

hello guys,
i want to genarate automatically a file which has 5 fields each Is it possible to initialize the NF( to 5) and NR( to 10 lines) using BEGIN in the awk script. The script will populate each file with data.

what's the syntax for outputing the data into these files???
I have the logic to do so , but having trouble with the syntax of awk langauge..

Reply With Quote
  #2  
Old July 12th, 2005, 08:24 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,098 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 9 h 5 m 46 sec
Reputation Power: 9
I DO NOT AGREE
a) ... I have the logic to do so , but having trouble with the syntax of awk langauge..
NO, you have no idea about the logic
b) you have no idea about awk (and other) languages
c) you have no idea about the problem
try to analyze the probl.
__________________
working on Solaris[5-9], preferred languages french and C.

Reply With Quote
  #3  
Old July 12th, 2005, 09:15 AM
zlutovsky zlutovsky is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Prague, Czech Rep.
Posts: 117 zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 42 m 44 sec
Reputation Power: 6
Sorry,

but you cannot set neither NF nor NR. They are set by awk when reading input. Look at man awk.

There is no help to you if you do not specify your point more precisely. Say what is the original form of your data. Then you can format it using awk or other tool, whatever is most appropriate. If you say what is necessary, I can help you.

Regards zlutovsky

Reply With Quote
  #4  
Old July 12th, 2005, 08:58 PM
sarahk sarahk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Location: Auckland, New Zealand
Posts: 6 sarahk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 32 sec
Reputation Power: 0
When is your assignment due?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > auto generation of files using awk


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT