Exforsys

Online Training

Want in Separate Line

This is a discussion on Want in Separate Line within the Shell Programming forums, part of the Operating Systems category; I am struck with a task in my UNIX operating system. I have thousands of files. What I want to ...


Go Back   Exforsys > Operating Systems > Shell Programming

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-13-2007, 08:19 AM
Senior Member
 
Join Date: Apr 2006
Posts: 162
sammy is on a distinguished road
Question Want in Separate Line

I am struck with a task in my UNIX operating system. I have thousands of files. What I want to do is I want to read all these files and get the output from these files with each word written in a separate line. I want this to be done to input this output to a database further for processing. Kindly help me or guide me to achieve the desired output.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-16-2007, 06:00 PM
Senior Member
 
Join Date: Apr 2006
Posts: 153
cyrus is on a distinguished road
You can try awk programming as below:
awk '{ for(x=2;x<=NF;x++) print $1, $x }' filename

By using the above you could read all your files and get the output from these files with each word written in a separate line. Try out and let us know for further needs.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

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


Similar Threads

Thread Thread Starter Forum Replies Last Post
Solaris x86 FAQ 2/2 Dan Anderson Tech FAQ 0 04-27-2004 08:24 PM
vi editor FAQ (Frequently Asked Question List), Part 2/2 E. Larry Lidz Tech FAQ 0 04-19-2004 01:02 AM
vi editor FAQ (Frequently Asked Question List), Part 1/2 E. Larry Lidz Tech FAQ 0 04-19-2004 01:02 AM
Apple II Csa2 FAQs: Telecom Hardware & Transfers, Part 20/25 rubywand@swbell.net Tech FAQ 0 04-04-2004 08:29 AM
Solving Lazy Initialization and double checked locking problem Vinay Aggarwal Software Patterns 19 02-18-2004 05:34 PM


All times are GMT -4. The time now is 05:18 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.