![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| how to make a line BLINKING in output and also how to increase font size in output | mail2sant | Shell Programming and Scripting | 3 | 04-14-2008 08:30 AM |
| converting hex to dec | aismann | Shell Programming and Scripting | 4 | 02-26-2008 05:51 AM |
| Converting gettimeoftheday output to string | p_aishwarya | UNIX for Dummies Questions & Answers | 1 | 10-21-2007 10:13 AM |
| Converting \0 to a \n | ajcannon | Shell Programming and Scripting | 2 | 09-28-2007 12:30 PM |
| sed converting / to \/ | sakthi.abdullah | UNIX for Advanced & Expert Users | 8 | 12-14-2006 03:56 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Converting to columnar output
Hi All,
I need some help in script or awk to create a textfile. I have a directory where two subdirectories exists say A and B. Now I need to write a ".txt" file with well arranged(space wraped) three columns in it with the data as follows: 1st column:Serial number(which will increment with the row number) 2nd column:With the filenames of those files existing inside directory A (I do have subfolders inside A) 3rd column:With the filenames of those files existing inside directory B (here also same problem, I have subfolders inside B). I tried outputing ls * and manipulating .. but was stuck in subfolders.. |
|
||||
|
INPUT:
Quote:
Quote:
|
|
||||
|
Now I am able to get all the output.
Only thing remaning is arranging them into three columns. What I have done is something like this: Code:
find /animals/humans -type f|awk -F/ '{print $NF}'>animals.lst
find /animals/fruits -type f|awk -F/ '{print $NF}'>fruits.lst
|
|
||||
|
Convert to columns
if u have a data:
Quote:
Column1 Column2 Column3 --------- -------- ---------- Quote:
That is using the three blank lines I want to separate the column to three. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|