[bash scripting] Generating a table with aligned fields
Hi everyone,
I want to write a function which calculates the space needed between fields, to generate a table with aligned fields, like when you type "ls -l", the operating system generates a table with beautifully aligned fields.
I've got this code so far:
Original file: tmpSearch
Result:
My code seems not good that it takes too much time to process.
Please help me to make it better.
I'm very new to shell scripting and trying to learn. If possible, please explain the meaning of the code.
I'm sorry for my bad English.
Any help is much appreciated.
** Edit: I feel stupid. Someone told me that I just need to simply use the "column -t" to accomplish this task. Thank you if anyone wanted to help me, and sorry for being stupid.
Actually I need it to be more general, I mean not just to be running on 9 columns, but any given number of columns. But anyways I have learned something nice in your code. Thanks a lot!
Hi,
I am trying to create a table through shell scripting . I used a command sqlplus -s to connect to sqlplus and user as sysdba. but there is a problem in it. can anyone please solve this .
#!/bin/bash
$(`sqlplus -s / as sysdba <<eof
create table sample (id,int);
insert into sample... (1 Reply)
1. The problem statement, all variables and given/known data:
I have to make a manufacturing company. I need subdirectories for the company using three departments: Human Resources, Manufacturing, and Sales. I also need three scripts in order to create tables for each sub directory. Each script... (11 Replies)
Okay. I've been charged with an assignment to create tables.
I "Made" a manufacturing company called "Suit and Tie". I need subdirectories for the company, using three departments: Human resources, Manufacturing, and Sales.
1) mkdir Suit_and_Tie
2) cd Suit_and_Tie
3) mkdir Human... (3 Replies)
Hi all,
I need a script to do some date/time conversion. It should take as an input a particular time. It should then generates a series of offsets, in both hour:minute form and number of milliseconds elapsed.
For 03:00, for example, it should give back 04:02:07 (3727000ms*) 05:04:14... (2 Replies)
Hi I recently joined a project where I have been asked to generate a report using shell script accessing UNIX box.
I have no idea on how to do it as I am a beginner and learning shell scripts.
Suppose I have a XML:
<XYZRequest>
<effectiveDate>someDate</effectiveDate>... (2 Replies)
Hello All,
I need to execute around 15 queries after which all data should come in Excel format.
Executing 15 queries is not a problem.
Problem is how to present/put data in excel.
kindly suggest me how to start, what to study or what should i do.
thanks, (1 Reply)
Hi
Can we create a rectangular table as i have attached in the query .
This is primarily for populating the created table with data gathered .
Hope I made myself clear ...
Pls suggest
Thanks (1 Reply)
Forgive the daft requests - I'm still a learner :D
I need a script so that I can test another script (I'm confused already) The script I am looking for should generate a new file in the same directory (called newfile1 or what ever) and also generate text within the new file (Hello world? What... (1 Reply)