| | |
How can i set column width in unix?
![]() |
•
•
Join Date: Jul 2007
Posts: 35
Reputation:
Solved Threads: 0
mY QUERY IS RELATED TO..
How can i set coloumn width in unix...
Like for ex. i am having a file, whose content is like
------------------------------
aba bba baba
abba baba baaa
addd ffff fffff
-----------------------------------
i want it to be like
-----------------------------------
aba bba baba
abba baba baaa
addd ffff fffff
------------------------------------
How can i set the coloumn width in unix... Please reply asap.
Thanks
How can i set coloumn width in unix...
Like for ex. i am having a file, whose content is like
------------------------------
aba bba baba
abba baba baaa
addd ffff fffff
-----------------------------------
i want it to be like
-----------------------------------
aba bba baba
abba baba baaa
addd ffff fffff
------------------------------------
How can i set the coloumn width in unix... Please reply asap.
Thanks
Depends on the editor.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
There is no "columns" There are tab sizes, but those only apply to the current session (also saved in preferences but only for the current user), so that doesn't help as the next person/viewer/editor won't have the same settings.
You best bet is, if your good at regex, to use search and replace to add in spaces. Even better, is to modify whatever "writes" the data to do that. Anyway, for vi, here:
http://www.cs.fsu.edu/general/vimanual.html
You best bet is, if your good at regex, to use search and replace to add in spaces. Even better, is to modify whatever "writes" the data to do that. Anyway, for vi, here:
http://www.cs.fsu.edu/general/vimanual.html
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Jul 2007
Posts: 35
Reputation:
Solved Threads: 0
•
•
•
•
There is no "columns" There are tab sizes, but those only apply to the current session (also saved in preferences but only for the current user), so that doesn't help as the next person/viewer/editor won't have the same settings.
You best bet is, if your good at regex, to use search and replace to add in spaces. Even better, is to modify whatever "writes" the data to do that. Anyway, for vi, here:
http://www.cs.fsu.edu/general/vimanual.html
awk -F"~" '{printf("%-15s%s~%s\n", $1,$2,$3)}' inputfile
ID1 Name1~Place1
ID2 Name2~Place2
ID3 Name3~Place3
Thanks guys for your help..
This may be late, but I wanted to get the "column" command into the fight!
Hope this helps!
-G
Shell Scripting Syntax (Toggle Plain Text)
$ column -t -s " " test.txt aba bba baba abba baba baaa addd ffff fffff
Hope this helps!
-G
![]() |
Similar Threads
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Open In New Window Php (PHP)
- Short guide to include RSS on your website (PHP)
Other Threads in the Shell Scripting Forum
- Previous Thread: Dynamically-created shell commands
- Next Thread: Bash script
| Thread Tools | Search this Thread |






