Exforsys
+ Reply to Thread
Results 1 to 2 of 2

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 ...

  1. #1
    sammy is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    144

    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.


  2. #2
    cyrus is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    128
    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.


Latest Article

Network Security Risk Assessment and Measurement

Read More...